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

Method replyDelTopic

server/topic.go:3298–3306  ·  view source on GitHub ↗

Handle request to delete the topic {del what="topic"}. 1. If requester is the owner then it should have been handled at the hub, log an error. 2. If requester is not the owner, treat it like {leave unsub=true}.

(sess *Session, asUid types.Uid, msg *ClientComMessage)

Source from the content-addressed store, hash-verified

3296// 1. If requester is the owner then it should have been handled at the hub, log an error.
3297// 2. If requester is not the owner, treat it like {leave unsub=true}.
3298func (t *Topic) replyDelTopic(sess *Session, asUid types.Uid, msg *ClientComMessage) error {
3299 if t.owner != asUid {
3300 return t.replyLeaveUnsub(sess, msg, asUid)
3301 }
3302
3303 // This is an indication of a bug.
3304 logs.Err.Println("replyDelTopic called by owner (SHOULD NOT HAPPEN!)")
3305 return nil
3306}
3307
3308// Delete credential
3309func (t *Topic) replyDelCred(sess *Session, asUid types.Uid, authLvl auth.Level, msg *ClientComMessage) error {

Callers 1

handleMetaDelMethod · 0.95

Calls 2

replyLeaveUnsubMethod · 0.95
PrintlnMethod · 0.80

Tested by

no test coverage detected