diff options
author | Wim <wim@42.be> | 2022-04-01 00:23:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 00:23:19 +0200 |
commit | c6716e030c02f316b887c1d3ee4b443aa3ab6afd (patch) | |
tree | 470461fe2d29662e7a69834ed21fce30beed65ab /vendor/github.com/mattermost/mattermost-server/v6/model/channel.go | |
parent | 4ab72acec656dafd304f88359b509b1f27c06604 (diff) | |
download | matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.gz matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.tar.bz2 matterbridge-msglm-c6716e030c02f316b887c1d3ee4b443aa3ab6afd.zip |
Update dependencies (#1784)
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v6/model/channel.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v6/model/channel.go | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v6/model/channel.go b/vendor/github.com/mattermost/mattermost-server/v6/model/channel.go index dfa40347..2f353c7c 100644 --- a/vendor/github.com/mattermost/mattermost-server/v6/model/channel.go +++ b/vendor/github.com/mattermost/mattermost-server/v6/model/channel.go @@ -6,6 +6,8 @@ package model import ( "crypto/sha1" "encoding/hex" + "encoding/json" + "errors" "io" "net/http" "sort" @@ -51,11 +53,11 @@ type Channel struct { ExtraUpdateAt int64 `json:"extra_update_at"` CreatorId string `json:"creator_id"` SchemeId *string `json:"scheme_id"` - Props map[string]interface{} `json:"props" db:"-"` + Props map[string]interface{} `json:"props"` GroupConstrained *bool `json:"group_constrained"` Shared *bool `json:"shared"` TotalMsgCountRoot int64 `json:"total_msg_count_root"` - PolicyID *string `json:"policy_id" db:"-"` + PolicyID *string `json:"policy_id"` LastRootPostAt int64 `json:"last_root_post_at"` } @@ -141,6 +143,8 @@ type ChannelSearchOpts struct { Private bool Page *int PerPage *int + LastDeleteAt int + LastUpdateAt int } type ChannelMemberCountByGroup struct { @@ -157,6 +161,23 @@ func WithID(ID string) ChannelOption { } } +// The following are some GraphQL methods necessary to return the +// data in float64 type. The spec doesn't support 64 bit integers, +// so we have to pass the data in float64. The _ at the end is +// a hack to keep the attribute name same in GraphQL schema. + +func (o *Channel) CreateAt_() float64 { + return float64(o.CreateAt) +} + +func (o *Channel) UpdateAt_() float64 { + return float64(o.UpdateAt) +} + +func (o *Channel) DeleteAt_() float64 { + return float64(o.DeleteAt) +} + func (o *Channel) DeepCopy() *Channel { copy := *o if copy.SchemeId != nil { @@ -303,6 +324,24 @@ func (o *Channel) GetOtherUserIdForDM(userId string) string { return otherUserId } +func (ChannelType) ImplementsGraphQLType(name string) bool { + return name == "ChannelType" +} + +func (t ChannelType) MarshalJSON() ([]byte, error) { + return json.Marshal(string(t)) +} + +func (t *ChannelType) UnmarshalGraphQL(input interface{}) error { + chType, ok := input.(string) + if !ok { + return errors.New("wrong type") + } + + *t = ChannelType(chType) + return nil +} + func GetDMNameFromIds(userId1, userId2 string) string { if userId1 > userId2 { return userId2 + "__" + userId1 |