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

Method mostRecentSession

server/topic.go:3684–3695  ·  view source on GitHub ↗

FIXME: this won't work correctly with multiplexing sessions.

()

Source from the content-addressed store, hash-verified

3682
3683// FIXME: this won't work correctly with multiplexing sessions.
3684func (t *Topic) mostRecentSession() *Session {
3685 var sess *Session
3686 var latest int64
3687 for s := range t.sessions {
3688 sessionLastAction := atomic.LoadInt64(&s.lastAction)
3689 if sessionLastAction > latest {
3690 sess = s
3691 latest = sessionLastAction
3692 }
3693 }
3694 return sess
3695}
3696
3697const (
3698 // Topic is fully initialized.

Callers 1

handleLeaveRequestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected