Get topic name suitable for the given client
(uid types.Uid)
| 3765 | |
| 3766 | // Get topic name suitable for the given client |
| 3767 | func (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 |
| 3785 | func (t *Topic) p2pOtherUser(uid types.Uid) types.Uid { |
no test coverage detected