diff options
Diffstat (limited to 'model/search_params.go')
-rw-r--r-- | model/search_params.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/search_params.go b/model/search_params.go index 802ec1be8..070ac6d24 100644 --- a/model/search_params.go +++ b/model/search_params.go @@ -4,6 +4,7 @@ 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 { |