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

Method handleMetaSet

server/topic.go:412–441  ·  view source on GitHub ↗
(msg *ClientComMessage, asUid types.Uid, asChan bool, authLevel auth.Level)

Source from the content-addressed store, hash-verified

410}
411
412func (t *Topic) handleMetaSet(msg *ClientComMessage, asUid types.Uid, asChan bool, authLevel auth.Level) {
413 if msg.MetaWhat&constMsgMetaDesc != 0 {
414 if err := t.replySetDesc(msg.sess, asUid, asChan, authLevel, msg); err == nil {
415 // Notify plugins of the update
416 pluginTopic(t, plgActUpd)
417 } else {
418 logs.Warn.Printf("topic[%s] meta.Set.Desc failed: %v", t.name, err)
419 }
420 }
421 if msg.MetaWhat&constMsgMetaSub != 0 {
422 if err := t.replySetSub(msg.sess, msg, asChan); err != nil {
423 logs.Warn.Printf("topic[%s] meta.Set.Sub failed: %v", t.name, err)
424 }
425 }
426 if msg.MetaWhat&constMsgMetaTags != 0 {
427 if err := t.replySetTags(msg.sess, asUid, msg); err != nil {
428 logs.Warn.Printf("topic[%s] meta.Set.Tags failed: %v", t.name, err)
429 }
430 }
431 if msg.MetaWhat&constMsgMetaCred != 0 {
432 if err := t.replySetCred(msg.sess, asUid, authLevel, msg); err != nil {
433 logs.Warn.Printf("topic[%s] meta.Set.Cred failed: %v", t.name, err)
434 }
435 }
436 if msg.MetaWhat&constMsgMetaAux != 0 {
437 if err := t.replySetAux(msg.sess, asUid, msg); err != nil {
438 logs.Warn.Printf("topic[%s] meta.Set.Aux failed: %v", t.name, err)
439 }
440 }
441}
442
443func (t *Topic) handleMetaDel(msg *ClientComMessage, asUid types.Uid, asChan bool, authLevel auth.Level) {
444 var err error

Callers 1

handleMetaMethod · 0.95

Calls 6

replySetDescMethod · 0.95
replySetSubMethod · 0.95
replySetTagsMethod · 0.95
replySetCredMethod · 0.95
replySetAuxMethod · 0.95
pluginTopicFunction · 0.85

Tested by

no test coverage detected