Skip notifications for expired sessions (#8934)

Этот коммит содержится в:
Daniel Schalla
2018-06-08 20:49:36 +02:00
коммит произвёл Harrison Healey
родитель 3bae67489f
Коммит ed59e2b735

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

@@ -752,6 +752,11 @@ func (a *App) sendPushNotification(post *model.Post, user *model.User, channel *
msg.Message = a.getPushNotificationMessage(post.Message, explicitMention, channelWideMention, hasFiles, senderName, channelName, channel.Type, replyToThreadType, userLocale)
for _, session := range sessions {
if session.IsExpired() {
continue
}
tmpMessage := *model.PushNotificationFromJson(strings.NewReader(msg.ToJson()))
tmpMessage.SetDeviceIdAndPlatform(session.DeviceId)