diff options
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/channel_member.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/channel_member.go | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/vendor/github.com/mattermost/platform/model/channel_member.go b/vendor/github.com/mattermost/platform/model/channel_member.go index 5de58bc4..f6d58519 100644 --- a/vendor/github.com/mattermost/platform/model/channel_member.go +++ b/vendor/github.com/mattermost/platform/model/channel_member.go @@ -1,4 +1,4 @@ -// 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 @@ -19,11 +19,11 @@ const ( ) type ChannelUnread struct { - TeamId string - TotalMsgCount int64 - MsgCount int64 - MentionCount int64 - NotifyProps StringMap + TeamId string `json:"team_id"` + ChannelId string `json:"channel_id"` + MsgCount int64 `json:"msg_count"` + MentionCount int64 `json:"mention_count"` + NotifyProps StringMap `json:"-"` } type ChannelMember struct { @@ -47,6 +47,15 @@ func (o *ChannelMembers) ToJson() string { } } +func (o *ChannelUnread) ToJson() string { + b, err := json.Marshal(o) + if err != nil { + return "" + } else { + return string(b) + } +} + func ChannelMembersFromJson(data io.Reader) *ChannelMembers { decoder := json.NewDecoder(data) var o ChannelMembers @@ -58,6 +67,17 @@ func ChannelMembersFromJson(data io.Reader) *ChannelMembers { } } +func ChannelUnreadFromJson(data io.Reader) *ChannelUnread { + decoder := json.NewDecoder(data) + var o ChannelUnread + err := decoder.Decode(&o) + if err == nil { + return &o + } else { + return nil + } +} + func (o *ChannelMember) ToJson() string { b, err := json.Marshal(o) if err != nil { |