| 486 | } |
| 487 | |
| 488 | func (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 | |
| 502 | func (t *Topic) handleUATimerEvent(currentUA string) { |
| 503 | // Publish user agent changes after a delay |