summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/status.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/status.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/status.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/status.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/vendor/github.com/mattermost/platform/model/status.go b/vendor/github.com/mattermost/platform/model/status.go
index fc155788..d838eea0 100644
--- a/vendor/github.com/mattermost/platform/model/status.go
+++ b/vendor/github.com/mattermost/platform/model/status.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
@@ -22,7 +22,7 @@ type Status struct {
Status string `json:"status"`
Manual bool `json:"manual"`
LastActivityAt int64 `json:"last_activity_at"`
- ActiveChannel string `json:"active_channel" db:"-"`
+ ActiveChannel string `json:"-" db:"-"`
}
func (o *Status) ToJson() string {
@@ -45,6 +45,26 @@ func StatusFromJson(data io.Reader) *Status {
}
}
+func StatusListToJson(u []*Status) string {
+ b, err := json.Marshal(u)
+ if err != nil {
+ return ""
+ } else {
+ return string(b)
+ }
+}
+
+func StatusListFromJson(data io.Reader) []*Status {
+ decoder := json.NewDecoder(data)
+ var statuses []*Status
+ err := decoder.Decode(&statuses)
+ if err == nil {
+ return statuses
+ } else {
+ return nil
+ }
+}
+
func StatusMapToInterfaceMap(statusMap map[string]*Status) map[string]interface{} {
interfaceMap := map[string]interface{}{}
for _, s := range statusMap {