summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorDaniel Schalla <daniel@schalla.me>2018-06-08 20:49:36 +0200
committerHarrison Healey <harrisonmhealey@gmail.com>2018-06-08 14:49:36 -0400
commited59e2b7357ad82573ea8a38b40172dc9672da44 (patch)
tree4c8c31cf69816a5f3126e1cf48e563f2c12d49bf /app/notification.go
parent3bae67489f53ad6501d3632cfa8847b2d09ebaff (diff)
downloadchat-ed59e2b7357ad82573ea8a38b40172dc9672da44.tar.gz
chat-ed59e2b7357ad82573ea8a38b40172dc9672da44.tar.bz2
chat-ed59e2b7357ad82573ea8a38b40172dc9672da44.zip
Skip notifications for expired sessions (#8934)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go5
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)