summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/search_params.go
diff options
context:
space:
mode:
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,
})