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

Method pushForP2PSub

server/push.go:111–119  ·  view source on GitHub ↗

Prepares payload to be delivered to a mobile device as a push notification in response to a new subscription in a p2p topic.

(fromUid, toUid types.Uid, want, given types.AccessMode, now time.Time)

Source from the content-addressed store, hash-verified

109
110// Prepares payload to be delivered to a mobile device as a push notification in response to a new subscription in a p2p topic.
111func (t *Topic) pushForP2PSub(fromUid, toUid types.Uid, want, given types.AccessMode, now time.Time) *push.Receipt {
112 receipt := t.preparePushForSubReceipt(fromUid, now)
113 receipt.Payload.ModeWant = want
114 receipt.Payload.ModeGiven = given
115
116 receipt.To[toUid] = push.Recipient{}
117
118 return receipt
119}
120
121// Prepares payload to be delivered to a mobile device as a push notification in response to a new subscription in a group topic.
122func (t *Topic) pushForGroupSub(fromUid types.Uid, now time.Time) *push.Receipt {

Callers 2

anotherUserSubMethod · 0.95

Calls 1

Tested by

no test coverage detected