From ed59e2b7357ad82573ea8a38b40172dc9672da44 Mon Sep 17 00:00:00 2001 From: Daniel Schalla Date: Fri, 8 Jun 2018 20:49:36 +0200 Subject: Skip notifications for expired sessions (#8934) --- app/notification.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/notification.go') 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) -- cgit v1.2.3-1-g7c22