From 7b7e73fb9290a8084989a4219681c636670e7555 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 29 Jun 2015 14:37:59 -0400 Subject: added team-wide and channel-wide mentions --- api/post.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'api/post.go') 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, "
", " ", -1), splitF) + splitMessage := strings.FieldsFunc(post.Message, splitF) for _, word := range splitMessage { // Non-case-sensitive check for regular keys -- cgit v1.2.3-1-g7c22 From 27eeabafe096013f1d0d368a65fe71ef230eab50 Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 1 Jul 2015 09:48:39 -0700 Subject: Facelifted "direct message" to "private message" --- api/post.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 2d812e8de..650f47062 100644 --- a/api/post.go +++ b/api/post.go @@ -227,7 +227,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { channel = result.Data.(*model.Channel) if channel.Type == model.CHANNEL_DIRECT { bodyText = "You have one new message." - subjectText = "New Direct Message" + subjectText = "New Private Message" } else { bodyText = "You have one new mention." subjectText = "New Mention" -- cgit v1.2.3-1-g7c22