summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go22
1 files changed, 5 insertions, 17 deletions
diff --git a/app/notification.go b/app/notification.go
index 4efdd3d6d..49576d1f0 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -222,23 +222,6 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe
)
}
- if hereNotification {
- statuses := GetAllStatuses()
- for _, status := range statuses {
- if status.UserId == post.UserId {
- continue
- }
-
- _, 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))
- }
- }
- }
-
// Make sure all mention updates are complete to prevent race
// Probably better to batch these DB updates in the future
// MUST be completed before push notifications send
@@ -790,6 +773,11 @@ func GetMentionKeywordsInChannel(profiles map[string]*model.User) map[string][]s
if int64(len(profiles)) < *utils.Cfg.TeamSettings.MaxNotificationsPerChannel && profile.NotifyProps["channel"] == "true" {
keywords["@channel"] = append(keywords["@channel"], profile.Id)
keywords["@all"] = append(keywords["@all"], profile.Id)
+
+ status := GetStatusFromCache(profile.Id)
+ if status != nil && status.Status == model.STATUS_ONLINE {
+ keywords["@here"] = append(keywords["@here"], profile.Id)
+ }
}
}