diff options
author | Daniel Schalla <daniel@schalla.me> | 2018-06-08 20:49:36 +0200 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2018-06-08 14:49:36 -0400 |
commit | ed59e2b7357ad82573ea8a38b40172dc9672da44 (patch) | |
tree | 4c8c31cf69816a5f3126e1cf48e563f2c12d49bf /app | |
parent | 3bae67489f53ad6501d3632cfa8847b2d09ebaff (diff) | |
download | chat-ed59e2b7357ad82573ea8a38b40172dc9672da44.tar.gz chat-ed59e2b7357ad82573ea8a38b40172dc9672da44.tar.bz2 chat-ed59e2b7357ad82573ea8a38b40172dc9672da44.zip |
Skip notifications for expired sessions (#8934)
Diffstat (limited to 'app')
-rw-r--r-- | app/notification.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/notification.go b/app/notification.go index a3c1857d5..dbd37c7f2 100644 --- a/app/notification.go +++ b/app/notification.go @@ -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) |