diff options
Diffstat (limited to 'api/post.go')
-rw-r--r-- | api/post.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/api/post.go b/api/post.go index 55e63cd23..d62b85059 100644 --- a/api/post.go +++ b/api/post.go @@ -682,7 +682,7 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel * var status *model.Status var err *model.AppError if status, err = GetStatus(id); err != nil { - status = &model.Status{id, model.STATUS_OFFLINE, false, 0} + status = &model.Status{id, model.STATUS_OFFLINE, false, 0, ""} } if userAllowsEmails && status.Status != model.STATUS_ONLINE { @@ -739,10 +739,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel * var status *model.Status var err *model.AppError if status, err = GetStatus(id); err != nil { - status = &model.Status{id, model.STATUS_OFFLINE, false, 0} + status = &model.Status{id, model.STATUS_OFFLINE, false, 0, ""} } - if profileMap[id].StatusAllowsPushNotification(status) { + if DoesStatusAllowPushNotification(profileMap[id], status, post.ChannelId) { sendPushNotification(post, profileMap[id], channel, senderName, true) } } @@ -752,10 +752,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel * var status *model.Status var err *model.AppError if status, err = GetStatus(id); err != nil { - status = &model.Status{id, model.STATUS_OFFLINE, false, 0} + status = &model.Status{id, model.STATUS_OFFLINE, false, 0, ""} } - if profileMap[id].StatusAllowsPushNotification(status) { + if DoesStatusAllowPushNotification(profileMap[id], status, post.ChannelId) { sendPushNotification(post, profileMap[id], channel, senderName, false) } } @@ -945,7 +945,6 @@ func sendPushNotification(post *model.Post, user *model.User, channel *model.Cha func clearPushNotification(userId string, channelId string) { session := getMobileAppSession(userId) - if session == nil { return } |