mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
client: add MemberCount helper method for lazy load summary
This commit is contained in:
parent
0b6fa137ce
commit
28bcc356db
1 changed files with 7 additions and 0 deletions
|
|
@ -341,6 +341,13 @@ type LazyLoadSummary struct {
|
|||
InvitedMemberCount *int `json:"m.invited_member_count,omitempty"`
|
||||
}
|
||||
|
||||
func (lls *LazyLoadSummary) MemberCount() int {
|
||||
if lls == nil {
|
||||
return 0
|
||||
}
|
||||
return ptr.Val(lls.JoinedMemberCount) + ptr.Val(lls.InvitedMemberCount)
|
||||
}
|
||||
|
||||
func (lls *LazyLoadSummary) Equal(other *LazyLoadSummary) bool {
|
||||
if lls == other {
|
||||
return true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue