loadContacts loads topic.perSubs to support presence notifications. perSubs contains (a) topics that the user wants to notify of his presence and (b) those which want to receive notifications from this user.
(uid types.Uid)
| 67 | // perSubs contains (a) topics that the user wants to notify of his presence and |
| 68 | // (b) those which want to receive notifications from this user. |
| 69 | func (t *Topic) loadContacts(uid types.Uid) error { |
| 70 | subs, err := store.Users.GetSubs(uid) |
| 71 | if err != nil { |
| 72 | return err |
| 73 | } |
| 74 | |
| 75 | for i := range subs { |
| 76 | t.addToPerSubs(subs[i].Topic, false, (subs[i].ModeGiven & subs[i].ModeWant).IsPresencer()) |
| 77 | } |
| 78 | return nil |
| 79 | } |
| 80 | |
| 81 | // This topic got a request from a 'me' topic to start/stop sending presence updates. |
| 82 | // The originating topic reports its own status in 'what' as "on", "off", "gone" or "?unkn". |
no test coverage detected