diff --git a/api4/resolver_channel_member_test.go b/api4/resolver_channel_member_test.go index cc6b6778f2..c6c8119f57 100644 --- a/api4/resolver_channel_member_test.go +++ b/api4/resolver_channel_member_test.go @@ -66,6 +66,7 @@ func TestGraphQLChannelMembers(t *testing.T) { MsgCount float64 `json:"msgCount"` MentionCount float64 `json:"mentionCount"` MentionCountRoot float64 `json:"mentionCountRoot"` + MsgCountRoot float64 `json:"msgCountRoot"` NotifyProps model.StringMap `json:"notifyProps"` SchemeGuest bool `json:"schemeGuest"` SchemeUser bool `json:"schemeUser"` @@ -100,6 +101,7 @@ func TestGraphQLChannelMembers(t *testing.T) { msgCount mentionCount mentionCountRoot + msgCountRoot schemeGuest schemeUser schemeAdmin diff --git a/api4/resolver_channel_test.go b/api4/resolver_channel_test.go index f5e7b458cf..6fd543bba1 100644 --- a/api4/resolver_channel_test.go +++ b/api4/resolver_channel_test.go @@ -40,6 +40,8 @@ func TestGraphQLChannels(t *testing.T) { Header string `json:"header"` Purpose string `json:"purpose"` SchemeId string `json:"schemeId"` + TotalMsgCountRoot float64 `json:"totalMsgCountRoot"` + LastRootPostAt float64 `json:"lastRootPostAt"` Cursor string `json:"cursor"` Team struct { ID string `json:"id"` @@ -70,6 +72,8 @@ func TestGraphQLChannels(t *testing.T) { header purpose schemeId + totalMsgCountRoot + lastRootPostAt cursor } } diff --git a/api4/schema.graphqls b/api4/schema.graphqls index 57eebb0b7a..717a05c247 100644 --- a/api4/schema.graphqls +++ b/api4/schema.graphqls @@ -58,6 +58,8 @@ type Channel { shared: Boolean lastPostAt: Float! totalMsgCount: Float! + totalMsgCountRoot: Float! + lastRootPostAt: Float! stats: ChannelStats cursor: String } @@ -70,6 +72,7 @@ type ChannelMember { msgCount : Float! mentionCount : Float! mentionCountRoot : Float! + msgCountRoot : Float! notifyProps : StringMap! lastUpdateAt : Float! schemeGuest : Boolean! diff --git a/model/channel.go b/model/channel.go index a43e6d67f8..be5f9fa203 100644 --- a/model/channel.go +++ b/model/channel.go @@ -188,6 +188,14 @@ func (o *Channel) TotalMsgCount_() float64 { return float64(o.TotalMsgCount) } +func (o *Channel) TotalMsgCountRoot_() float64 { + return float64(o.TotalMsgCountRoot) +} + +func (o *Channel) LastRootPostAt_() float64 { + return float64(o.LastRootPostAt) +} + func (o *Channel) DeepCopy() *Channel { copy := *o if copy.SchemeId != nil { diff --git a/model/channel_member.go b/model/channel_member.go index 64bdbd3d2f..c9c1b0a057 100644 --- a/model/channel_member.go +++ b/model/channel_member.go @@ -81,6 +81,10 @@ func (o *ChannelMember) MentionCountRoot_() float64 { return float64(o.MentionCountRoot) } +func (o *ChannelMember) MsgCountRoot_() float64 { + return float64(o.MsgCountRoot) +} + func (o *ChannelMember) LastUpdateAt_() float64 { return float64(o.LastUpdateAt) }