mirror of
https://github.com/pushbits/server.git
synced 2025-06-07 05:02:04 +02:00
clean up
This commit is contained in:
parent
975c0a246b
commit
c5e4669fda
2 changed files with 9 additions and 4 deletions
|
@ -82,10 +82,15 @@ func (d *Dispatcher) DeleteNotification(a *model.Application, n *model.DeleteNot
|
||||||
|
|
||||||
if val, ok := deleteMessage.Content["body"]; ok {
|
if val, ok := deleteMessage.Content["body"]; ok {
|
||||||
body, ok := val.(string)
|
body, ok := val.(string)
|
||||||
if ok {
|
|
||||||
oldBody = body
|
if !ok {
|
||||||
oldFormattedBody = body
|
log.Println("Event does not have a body")
|
||||||
|
return api.ErrorMessageNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oldBody = body
|
||||||
|
oldFormattedBody = body
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.Println("Message to delete has wrong format")
|
log.Println("Message to delete has wrong format")
|
||||||
return api.ErrorMessageNotFound
|
return api.ErrorMessageNotFound
|
||||||
|
|
|
@ -16,7 +16,7 @@ type Notification struct {
|
||||||
Date time.Time `json:"date"`
|
Date time.Time `json:"date"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteNotification holds information like the message, the reply to message id and the priority of a deletion notification.
|
// DeleteNotification holds information like the message ID of a deletion notification.
|
||||||
type DeleteNotification struct {
|
type DeleteNotification struct {
|
||||||
ID string `json:"id" form:"id"`
|
ID string `json:"id" form:"id"`
|
||||||
Date time.Time `json:"date"`
|
Date time.Time `json:"date"`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue