MCPcopy Create free account
hub / github.com/tinode/chat / channelSubUnsub

Method channelSubUnsub

server/push.go:18–24  ·  view source on GitHub ↗

Subscribe or unsubscribe user to/from FCM topic (channel).

(uid types.Uid, sub bool)

Source from the content-addressed store, hash-verified

16
17// Subscribe or unsubscribe user to/from FCM topic (channel).
18func (t *Topic) channelSubUnsub(uid types.Uid, sub bool) {
19 push.ChannelSub(&push.ChannelReq{
20 Uid: uid,
21 Channel: types.GrpToChn(t.name),
22 Unsub: !sub,
23 })
24}
25
26// Prepares a payload to be delivered to a mobile device as a push notification in response to a {data} message.
27func (t *Topic) pushForData(fromUid types.Uid, data *MsgServerData, msgMarkedAsReadBySender bool) *push.Receipt {

Callers 3

thisUserSubMethod · 0.95
replyLeaveUnsubMethod · 0.95

Calls 2

ChannelSubFunction · 0.92
GrpToChnFunction · 0.92

Tested by

no test coverage detected