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

Method CreateP2P

server/store/store.go:551–558  ·  view source on GitHub ↗

CreateP2P creates a P2P topic by generating two user's subsciptions to each other.

(initiator, invited *types.Subscription)

Source from the content-addressed store, hash-verified

549
550// CreateP2P creates a P2P topic by generating two user's subsciptions to each other.
551func (topicsMapper) CreateP2P(initiator, invited *types.Subscription) error {
552 initiator.InitTimes()
553 initiator.SetTouchedAt(initiator.CreatedAt)
554 invited.InitTimes()
555 invited.SetTouchedAt(invited.CreatedAt)
556
557 return adp.TopicCreateP2P(initiator, invited)
558}
559
560// Get a single topic with a list of relevant users de-normalized into it
561func (topicsMapper) Get(topic string) (*types.Topic, error) {

Callers

nothing calls this directly

Calls 3

InitTimesMethod · 0.80
SetTouchedAtMethod · 0.80
TopicCreateP2PMethod · 0.65

Tested by

no test coverage detected