diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-10-17 14:37:51 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-10-19 13:25:19 -0400 |
commit | 06fd374c1907add3faeeba7916b279e0a3302a4e (patch) | |
tree | 278094fd30b875ed431467e7505294edf1852e56 /api/post.go | |
parent | 754f1721fe77b3f842277d1c72e25e83cf993133 (diff) | |
download | chat-06fd374c1907add3faeeba7916b279e0a3302a4e.tar.gz chat-06fd374c1907add3faeeba7916b279e0a3302a4e.tar.bz2 chat-06fd374c1907add3faeeba7916b279e0a3302a4e.zip |
Added from:, in:, and channel: search modifiers
Diffstat (limited to 'api/post.go')
-rw-r--r-- | api/post.go | 10 |
1 files changed, 5 insertions, 5 deletions
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{} |