summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-06-30 11:58:22 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-06-30 11:58:22 -0400
commita00b4e00adeacfbe59b523d46e566186631eab52 (patch)
tree83949f6e97ecac3c09084b06c943b1fdf33f8873 /api/post.go
parentae21685e357416dab708e304fd8d9c005b11278d (diff)
parent8be4df00b4d30c220d6f0d13734501c8c94e6495 (diff)
downloadchat-a00b4e00adeacfbe59b523d46e566186631eab52.tar.gz
chat-a00b4e00adeacfbe59b523d46e566186631eab52.tar.bz2
chat-a00b4e00adeacfbe59b523d46e566186631eab52.zip
Merge pull request #106 from mattermost/mm-1119
fixes mm-1119 adds @all and @channel mention capabilites
Diffstat (limited to 'api/post.go')
-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