summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/search_params.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-08-16 23:37:37 +0200
committerWim <wim@42.be>2017-08-16 23:37:37 +0200
commitb963f83c6a09da1eaf02eb9f269c6f5881a0c711 (patch)
tree5ec37162046349d23c627e9ee26fb70c1a6c4f08 /vendor/github.com/mattermost/platform/model/search_params.go
parentf6297ebbb09611165a50a6cd15abf6499268cf86 (diff)
downloadmatterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.tar.gz
matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.tar.bz2
matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.zip
Update mattermost vendor (3.7 => 4.1)
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/search_params.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/search_params.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/vendor/github.com/mattermost/platform/model/search_params.go b/vendor/github.com/mattermost/platform/model/search_params.go
index 1772c902..070ac6d2 100644
--- a/vendor/github.com/mattermost/platform/model/search_params.go
+++ b/vendor/github.com/mattermost/platform/model/search_params.go
@@ -1,9 +1,10 @@
-// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
import (
+ "encoding/json"
"regexp"
"strings"
)
@@ -19,6 +20,15 @@ type SearchParams struct {
OrTerms bool
}
+func (o *SearchParams) ToJson() string {
+ b, err := json.Marshal(o)
+ if err != nil {
+ return ""
+ } else {
+ return string(b)
+ }
+}
+
var searchFlags = [...]string{"from", "channel", "in"}
func splitWordsNoQuotes(text string) []string {
@@ -165,7 +175,7 @@ func ParseSearchParams(text string) []*SearchParams {
if len(plainTerms) == 0 && len(hashtagTerms) == 0 && (len(inChannels) != 0 || len(fromUsers) != 0) {
paramsList = append(paramsList, &SearchParams{
Terms: "",
- IsHashtag: true,
+ IsHashtag: false,
InChannels: inChannels,
FromUsers: fromUsers,
})