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

Method handleTopicTimeout

server/topic.go:511–522  ·  view source on GitHub ↗
(hub *Hub, currentUA string, uaTimer, defrNotifTimer *time.Timer)

Source from the content-addressed store, hash-verified

509}
510
511func (t *Topic) handleTopicTimeout(hub *Hub, currentUA string, uaTimer, defrNotifTimer *time.Timer) {
512 // Topic timeout
513 hub.unreg <- &topicUnreg{rcptTo: t.name}
514 defrNotifTimer.Stop()
515 switch t.cat {
516 case types.TopicCatMe:
517 uaTimer.Stop()
518 t.presUsersOfInterest("off", currentUA)
519 case types.TopicCatGrp:
520 t.presSubsOffline("off", nilPresParams, nilPresFilters, nilPresFilters, "", false)
521 }
522}
523
524func (t *Topic) handleTopicTermination(sd *shutDown) {
525 // Handle four cases:

Callers 2

runLocalMethod · 0.95
TestHandleTopicTimeoutFunction · 0.80

Calls 3

presUsersOfInterestMethod · 0.95
presSubsOfflineMethod · 0.95
StopMethod · 0.65

Tested by 1

TestHandleTopicTimeoutFunction · 0.64