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

Method original

server/topic.go:3767–3782  ·  view source on GitHub ↗

Get topic name suitable for the given client

(uid types.Uid)

Source from the content-addressed store, hash-verified

3765
3766// Get topic name suitable for the given client
3767func (t *Topic) original(uid types.Uid) string {
3768 if t.cat == types.TopicCatP2P {
3769 if pud, ok := t.perUser[uid]; ok {
3770 return pud.topicName
3771 }
3772 panic("Invalid P2P topic")
3773 }
3774
3775 if t.cat == types.TopicCatGrp && t.isChan {
3776 if t.perUser[uid].isChan {
3777 // This is a channel reader.
3778 return types.GrpToChn(t.xoriginal)
3779 }
3780 }
3781 return t.xoriginal
3782}
3783
3784// Get ID of the other user in a P2P topic
3785func (t *Topic) p2pOtherUser(uid types.Uid) types.Uid {

Callers 15

handleCallEventMethod · 0.95
handlePubBroadcastMethod · 0.95
subscriptionReplyMethod · 0.95
replyGetDataMethod · 0.95
replyGetTagsMethod · 0.95
replyGetCredsMethod · 0.95
replySetCredMethod · 0.95
replyGetAuxMethod · 0.95

Calls 1

GrpToChnFunction · 0.92

Tested by

no test coverage detected