summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-06-29 14:37:59 -0400
committerJoramWilander <jwawilander@gmail.com>2015-06-29 14:37:59 -0400
commit7b7e73fb9290a8084989a4219681c636670e7555 (patch)
tree5de4540861b954e2d3d43b8e19e2597114dacaa6 /api
parent0792eb18d535410b456f3cc569e243efb85a47b6 (diff)
downloadchat-7b7e73fb9290a8084989a4219681c636670e7555.tar.gz
chat-7b7e73fb9290a8084989a4219681c636670e7555.tar.bz2
chat-7b7e73fb9290a8084989a4219681c636670e7555.zip
added team-wide and channel-wide mentions
Diffstat (limited to 'api')
-rw-r--r--api/post.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/api/post.go b/api/post.go
index 99cbdcb85..2d812e8de 100644
--- a/api/post.go
+++ b/api/post.go
@@ -273,7 +273,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) {
} else {
- // Find out who is a member of the channel only keep those profiles
+ // Find out who is a member of the channel, only keep those profiles
if eResult := <-echan; eResult.Err != nil {
l4g.Error("Failed to get channel members channel_id=%v err=%v", post.ChannelId, eResult.Err.Message)
return
@@ -306,13 +306,23 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) {
}
}
}
+
+ // Add @all to keywords if user has them turned on
+ if profile.NotifyProps["all"] == "true" {
+ keywordMap["@all"] = append(keywordMap["@all"], profile.Id)
+ }
+
+ // Add @channel to keywords if user has them turned on
+ if profile.NotifyProps["channel"] == "true" {
+ keywordMap["@channel"] = append(keywordMap["@channel"], profile.Id)
+ }
}
// Build a map as a list of unique user_ids that are mentioned in this post
splitF := func(c rune) bool {
return model.SplitRunes[c]
}
- splitMessage := strings.FieldsFunc(strings.Replace(post.Message, "<br>", " ", -1), splitF)
+ splitMessage := strings.FieldsFunc(post.Message, splitF)
for _, word := range splitMessage {
// Non-case-sensitive check for regular keys