MCPcopy
hub / github.com/tinode/chat / subsCount

Method subsCount

server/topic.go:3869–3880  ·  view source on GitHub ↗

subsCount returns the number of topic subscribers. This method is different from subCnt with respect to channels: * subsCount counts subscribers + attached channel users. * subCnt counts all subscribers (including all channel users).

()

Source from the content-addressed store, hash-verified

3867// * subsCount counts subscribers + attached channel users.
3868// * subCnt counts all subscribers (including all channel users).
3869func (t *Topic) subsCount() int {
3870 if t.cat == types.TopicCatP2P {
3871 count := 0
3872 for uid := range t.perUser {
3873 if !t.perUser[uid].deleted {
3874 count++
3875 }
3876 }
3877 return count
3878 }
3879 return len(t.perUser)
3880}
3881
3882// Add session record. 'user' may be different from sess.uid.
3883func (t *Topic) addSession(sess *Session, asUid types.Uid, isChanSub bool) {

Callers 7

pushForDataMethod · 0.95
thisUserSubMethod · 0.95
anotherUserSubMethod · 0.95
replyDelSubMethod · 0.95
replyLeaveUnsubMethod · 0.95
topicUnregMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected