4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-27 16:59:23 +00:00

Sync with mattermost 3.6.0

This commit is contained in:
Wim
2017-01-16 23:59:50 +01:00
parent 9987ac3f13
commit 93114b7682
26 changed files with 710 additions and 91 deletions

View File

@ -16,6 +16,12 @@ type TeamMember struct {
DeleteAt int64 `json:"delete_at"`
}
type TeamUnread struct {
TeamId string `json:"team_id"`
MsgCount int64 `json:"msg_count"`
MentionCount int64 `json:"mention_count"`
}
func (o *TeamMember) ToJson() string {
b, err := json.Marshal(o)
if err != nil {
@ -55,6 +61,25 @@ func TeamMembersFromJson(data io.Reader) []*TeamMember {
}
}
func TeamsUnreadToJson(o []*TeamUnread) string {
if b, err := json.Marshal(o); err != nil {
return "[]"
} else {
return string(b)
}
}
func TeamsUnreadFromJson(data io.Reader) []*TeamUnread {
decoder := json.NewDecoder(data)
var o []*TeamUnread
err := decoder.Decode(&o)
if err == nil {
return o
} else {
return nil
}
}
func (o *TeamMember) IsValid() *AppError {
if len(o.TeamId) != 26 {