summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-11-09 14:46:20 -0600
committerGitHub <noreply@github.com>2017-11-09 14:46:20 -0600
commit10c5a927cb619f1aa2a599cbe3667820f4766bda (patch)
treef415540ab66115e62928d304c99b533398d7f226 /app/notification.go
parentb0c18ece0988b1573b2286bb73b32e48a1d8c59a (diff)
downloadchat-10c5a927cb619f1aa2a599cbe3667820f4766bda.tar.gz
chat-10c5a927cb619f1aa2a599cbe3667820f4766bda.tar.bz2
chat-10c5a927cb619f1aa2a599cbe3667820f4766bda.zip
more global config ref cleanup (#7802)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/notification.go b/app/notification.go
index 01f76ab33..386016250 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -69,7 +69,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
mentionedUserIds[post.UserId] = true
}
} else {
- keywords := GetMentionKeywordsInChannel(profileMap, post.Type != model.POST_HEADER_CHANGE && post.Type != model.POST_PURPOSE_CHANGE)
+ keywords := a.GetMentionKeywordsInChannel(profileMap, post.Type != model.POST_HEADER_CHANGE && post.Type != model.POST_PURPOSE_CHANGE)
var potentialOtherMentions []string
mentionedUserIds, potentialOtherMentions, hereNotification, channelNotification, allNotification = GetExplicitMentions(post.Message, keywords)
@@ -909,7 +909,7 @@ func removeCodeFromMessage(message string) string {
// Given a map of user IDs to profiles, returns a list of mention
// keywords for all users in the channel.
-func GetMentionKeywordsInChannel(profiles map[string]*model.User, lookForSpecialMentions bool) map[string][]string {
+func (a *App) GetMentionKeywordsInChannel(profiles map[string]*model.User, lookForSpecialMentions bool) map[string][]string {
keywords := make(map[string][]string)
for id, profile := range profiles {
@@ -933,7 +933,7 @@ func GetMentionKeywordsInChannel(profiles map[string]*model.User, lookForSpecial
// Add @channel and @all to keywords if user has them turned on
if lookForSpecialMentions {
- if int64(len(profiles)) < *utils.Cfg.TeamSettings.MaxNotificationsPerChannel && profile.NotifyProps["channel"] == "true" {
+ if int64(len(profiles)) < *a.Config().TeamSettings.MaxNotificationsPerChannel && profile.NotifyProps["channel"] == "true" {
keywords["@channel"] = append(keywords["@channel"], profile.Id)
keywords["@all"] = append(keywords["@all"], profile.Id)