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

Method infoSubsOffline

server/pres.go:479–501  ·  view source on GitHub ↗

Publish {info what=read|recv|kp} to topic subscribers's sessions currently offline in the topic, on subscriber's 'me'. Group and P2P.

(from types.Uid, what string, seq int, skipSid string)

Source from the content-addressed store, hash-verified

477// Publish {info what=read|recv|kp} to topic subscribers's sessions currently offline in the topic,
478// on subscriber's 'me'. Group and P2P.
479func (t *Topic) infoSubsOffline(from types.Uid, what string, seq int, skipSid string) {
480 user := from.UserId()
481
482 for uid, pud := range t.perUser {
483 mode := pud.modeGiven & pud.modeWant
484 if pud.deleted || !mode.IsPresencer() || !mode.IsReader() {
485 continue
486 }
487
488 globals.hub.routeSrv <- &ServerComMessage{
489 Info: &MsgServerInfo{
490 Topic: "me",
491 Src: t.original(uid),
492 From: user,
493 What: what,
494 SeqId: seq,
495 SkipTopic: t.name,
496 },
497 RcptTo: uid.UserId(),
498 SkipSid: skipSid,
499 }
500 }
501}
502
503// Publish {info what=call} to topic subscribers's sessions on subscriber's 'me'.
504func (t *Topic) infoCallSubsOffline(from string, target types.Uid, event string, seq int,

Callers 1

handleNoteBroadcastMethod · 0.95

Calls 4

originalMethod · 0.95
UserIdMethod · 0.80
IsPresencerMethod · 0.80
IsReaderMethod · 0.80

Tested by

no test coverage detected