summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-14 10:27:34 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-02-14 10:27:34 -0500
commit4149e82455d2645d7bc5c910f72c7e311d2a5920 (patch)
treeb97d2dfb4d0fcbbf345a09cdd49bcea0aeac8802 /app
parenta2e6553b7fa66835abce779fc25e8bef110151ca (diff)
downloadchat-4149e82455d2645d7bc5c910f72c7e311d2a5920.tar.gz
chat-4149e82455d2645d7bc5c910f72c7e311d2a5920.tar.bz2
chat-4149e82455d2645d7bc5c910f72c7e311d2a5920.zip
Fix here notifications (#5377)
Diffstat (limited to 'app')
-rw-r--r--app/notification.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/app/notification.go b/app/notification.go
index fdff13c4f..e707b3d22 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -196,22 +196,18 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe
}
if hereNotification {
- if result := <-Srv.Store.Status().GetOnline(); result.Err != nil {
- return nil, result.Err
- } else {
- statuses := result.Data.([]*model.Status)
- for _, status := range statuses {
- if status.UserId == post.UserId {
- continue
- }
+ statuses := GetAllStatuses()
+ for _, status := range statuses {
+ if status.UserId == post.UserId {
+ continue
+ }
- _, profileFound := profileMap[status.UserId]
- _, alreadyMentioned := mentionedUserIds[status.UserId]
+ _, profileFound := profileMap[status.UserId]
+ _, alreadyMentioned := mentionedUserIds[status.UserId]
- if status.Status == model.STATUS_ONLINE && profileFound && !alreadyMentioned {
- mentionedUsersList = append(mentionedUsersList, status.UserId)
- updateMentionChans = append(updateMentionChans, Srv.Store.Channel().IncrementMentionCount(post.ChannelId, status.UserId))
- }
+ if status.Status == model.STATUS_ONLINE && profileFound && !alreadyMentioned {
+ mentionedUsersList = append(mentionedUsersList, status.UserId)
+ updateMentionChans = append(updateMentionChans, Srv.Store.Channel().IncrementMentionCount(post.ChannelId, status.UserId))
}
}
}