summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-20 14:50:03 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-20 14:50:03 -0700
commite1f94590290bf3061fdce48b25b2e74a2c8a0853 (patch)
treeb67ae40ea40f64f2e6c5a29e50b78199ed9a2c63 /api/post.go
parent1fc12dd8ba2238eba7d154eee55e1381e7415372 (diff)
parente0cda76eb816da8fda9c42d67197be71201c242e (diff)
downloadchat-e1f94590290bf3061fdce48b25b2e74a2c8a0853.tar.gz
chat-e1f94590290bf3061fdce48b25b2e74a2c8a0853.tar.bz2
chat-e1f94590290bf3061fdce48b25b2e74a2c8a0853.zip
Merge branch 'master' into PLT-44
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/api/post.go b/api/post.go
index ded71f727..79f84e04d 100644
--- a/api/post.go
+++ b/api/post.go
@@ -201,7 +201,7 @@ func handlePostEventsAndForget(c *Context, post *model.Post, triggerWebhooks boo
channel = result.Data.(*model.Channel)
}
- fireAndForgetNotifications(c, post, team, channel)
+ sendNotificationsAndForget(c, post, team, channel)
var user *model.User
if result := <-uchan; result.Err != nil {
@@ -299,7 +299,7 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team
}
-func fireAndForgetNotifications(c *Context, post *model.Post, team *model.Team, channel *model.Channel) {
+func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, channel *model.Channel) {
go func() {
// Get a list of user names (to be used as keywords) and ids for the given team
@@ -434,7 +434,7 @@ func fireAndForgetNotifications(c *Context, post *model.Post, team *model.Team,
}
for id := range toEmailMap {
- fireAndForgetMentionUpdate(post.ChannelId, id)
+ updateMentionCountAndForget(post.ChannelId, id)
}
}
@@ -530,7 +530,7 @@ func fireAndForgetNotifications(c *Context, post *model.Post, team *model.Team,
alreadySeen[session.DeviceId] = session.DeviceId
- utils.FireAndForgetSendAppleNotify(session.DeviceId, subjectPage.Render(), 1)
+ utils.SendAppleNotifyAndForget(session.DeviceId, subjectPage.Render(), 1)
}
}
}
@@ -562,7 +562,7 @@ func fireAndForgetNotifications(c *Context, post *model.Post, team *model.Team,
}()
}
-func fireAndForgetMentionUpdate(channelId, userId string) {
+func updateMentionCountAndForget(channelId, userId string) {
go func() {
if result := <-Srv.Store.Channel().IncrementMentionCount(channelId, userId); result.Err != nil {
l4g.Error("Failed to update mention count for user_id=%v on channel_id=%v err=%v", userId, channelId, result.Err)
@@ -820,16 +820,16 @@ func searchPosts(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- hashtagTerms, plainTerms := model.ParseHashtags(terms)
+ plainSearchParams, hashtagSearchParams := model.ParseSearchParams(terms)
var hchan store.StoreChannel
- if len(hashtagTerms) != 0 {
- hchan = Srv.Store.Post().Search(c.Session.TeamId, c.Session.UserId, hashtagTerms, true)
+ if hashtagSearchParams != nil {
+ hchan = Srv.Store.Post().Search(c.Session.TeamId, c.Session.UserId, hashtagSearchParams)
}
var pchan store.StoreChannel
- if len(plainTerms) != 0 {
- pchan = Srv.Store.Post().Search(c.Session.TeamId, c.Session.UserId, terms, false)
+ if plainSearchParams != nil {
+ pchan = Srv.Store.Post().Search(c.Session.TeamId, c.Session.UserId, plainSearchParams)
}
mainList := &model.PostList{}