MCPcopy Index your code
hub / github.com/tinode/chat / handleSessionUpdate

Method handleSessionUpdate

server/topic.go:488–500  ·  view source on GitHub ↗
(upd *sessionUpdate, currentUA *string, uaTimer *time.Timer)

Source from the content-addressed store, hash-verified

486}
487
488func (t *Topic) handleSessionUpdate(upd *sessionUpdate, currentUA *string, uaTimer *time.Timer) {
489 if upd.sess != nil {
490 // 'me' & 'grp' only. Background session timed out and came online.
491 t.sessToForeground(upd.sess)
492 } else if *currentUA != upd.userAgent {
493 if t.cat != types.TopicCatMe {
494 logs.Warn.Panicln("invalid topic category in UA update", t.name)
495 }
496 // 'me' only. Process an update to user agent from one of the sessions.
497 *currentUA = upd.userAgent
498 uaTimer.Reset(uaTimerDelay)
499 }
500}
501
502func (t *Topic) handleUATimerEvent(currentUA string) {
503 // Publish user agent changes after a delay

Callers 3

runLocalMethod · 0.95

Calls 2

sessToForegroundMethod · 0.95
ResetMethod · 0.45