From 06fd374c1907add3faeeba7916b279e0a3302a4e Mon Sep 17 00:00:00 2001 From: hmhealey Date: Sat, 17 Oct 2015 14:37:51 -0400 Subject: Added from:, in:, and channel: search modifiers --- api/post.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 58fd3488a..ecc319a91 100644 --- a/api/post.go +++ b/api/post.go @@ -680,16 +680,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{} -- cgit v1.2.3-1-g7c22 From 04bf527966db559523fb0ec317af5076241f1bc5 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 14 Oct 2015 16:56:13 -0700 Subject: Changed all goroutine functions to use '...AndForget' as the standard naming system --- api/post.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 73a63cb72..1d6cec5dd 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) -- cgit v1.2.3-1-g7c22