MM-20347 Move ID Loaded Push Notifications to E20 (#13185)

* Move ID Loaded Push Notifications to E20

* Fix model tests
Этот коммит содержится в:
Elias Nahum
2019-11-21 19:35:19 -03:00
коммит произвёл GitHub
родитель 0b00a7870b
Коммит 3e9cd464de
16 изменённых файлов: 125 добавлений и 205 удалений

Просмотреть файл

@@ -410,7 +410,7 @@ func pushNotificationAck(c *Context, w http.ResponseWriter, r *http.Request) {
}
err := c.App.SendAckToPushProxy(ack)
if ack.NotificationType == model.PUSH_TYPE_ID_LOADED {
if ack.IsIdLoaded {
if err != nil {
// Log the error only, then continue to fetch notification message
c.App.NotificationsLog.Error("Notification ack not sent to push proxy",
@@ -421,9 +421,16 @@ func pushNotificationAck(c *Context, w http.ResponseWriter, r *http.Request) {
)
}
msg, appErr := c.App.BuildFetchedPushNotificationMessage(ack.PostId, c.App.Session.UserId)
if appErr != nil {
c.Err = model.NewAppError("pushNotificationAck", "api.push_notification.id_loaded.fetch.app_error", nil, appErr.Error(), http.StatusInternalServerError)
notificationInterface := c.App.Notification
if notificationInterface == nil {
c.Err = model.NewAppError("pushNotificationAck", "api.system.id_loaded.not_available.app_error", nil, "", http.StatusFound)
return
}
msg, appError := notificationInterface.GetNotificationMessage(ack, c.App.Session.UserId)
if appError != nil {
c.Err = model.NewAppError("pushNotificationAck", "api.push_notification.id_loaded.fetch.app_error", nil, appError.Error(), http.StatusInternalServerError)
return
}