mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-09-16 07:12:31 +00:00
Update mattermost vendor (3.7 => 4.1)
This commit is contained in:
24
vendor/github.com/mattermost/platform/model/status.go
generated
vendored
24
vendor/github.com/mattermost/platform/model/status.go
generated
vendored
@@ -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 {
|
||||
|
Reference in New Issue
Block a user