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).
()
| 3867 | // * subsCount counts subscribers + attached channel users. |
| 3868 | // * subCnt counts all subscribers (including all channel users). |
| 3869 | func (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. |
| 3883 | func (t *Topic) addSession(sess *Session, asUid types.Uid, isChanSub bool) { |
no outgoing calls
no test coverage detected