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

Method handleMetaGet

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

Source from the content-addressed store, hash-verified

371}
372
373func (t *Topic) handleMetaGet(msg *ClientComMessage, asUid types.Uid, asChan bool, authLevel auth.Level) {
374 if msg.MetaWhat&constMsgMetaDesc != 0 {
375 if err := t.replyGetDesc(msg.sess, asUid, asChan, msg.Get.Desc, msg); err != nil {
376 logs.Warn.Printf("topic[%s] meta.Get.Desc failed: %s", t.name, err)
377 }
378 }
379 if msg.MetaWhat&constMsgMetaSub != 0 {
380 if err := t.replyGetSub(msg.sess, asUid, authLevel, asChan, msg); err != nil {
381 logs.Warn.Printf("topic[%s] meta.Get.Sub failed: %s", t.name, err)
382 }
383 }
384 if msg.MetaWhat&constMsgMetaData != 0 {
385 if err := t.replyGetData(msg.sess, asUid, asChan, msg.Get.Data, msg); err != nil {
386 logs.Warn.Printf("topic[%s] meta.Get.Data failed: %s", t.name, err)
387 }
388 }
389 if msg.MetaWhat&constMsgMetaDel != 0 {
390 if err := t.replyGetDel(msg.sess, asUid, msg.Get.Del, msg); err != nil {
391 logs.Warn.Printf("topic[%s] meta.Get.Del failed: %s", t.name, err)
392 }
393 }
394 if msg.MetaWhat&constMsgMetaTags != 0 {
395 if err := t.replyGetTags(msg.sess, asUid, msg); err != nil {
396 logs.Warn.Printf("topic[%s] meta.Get.Tags failed: %s", t.name, err)
397 }
398 }
399 if msg.MetaWhat&constMsgMetaCred != 0 {
400 if err := t.replyGetCreds(msg.sess, asUid, msg); err != nil {
401 logs.Warn.Printf("topic[%s] meta.Get.Creds failed: %s", t.name, err)
402 }
403 }
404 if msg.MetaWhat&constMsgMetaAux != 0 {
405 logs.Warn.Printf("topic[%s] handle getAux", t.name)
406 if err := t.replyGetAux(msg.sess, asUid, msg); err != nil {
407 logs.Warn.Printf("topic[%s] meta.Get.Aux failed: %s", t.name, err)
408 }
409 }
410}
411
412func (t *Topic) handleMetaSet(msg *ClientComMessage, asUid types.Uid, asChan bool, authLevel auth.Level) {
413 if msg.MetaWhat&constMsgMetaDesc != 0 {

Callers 1

handleMetaMethod · 0.95

Calls 7

replyGetDescMethod · 0.95
replyGetSubMethod · 0.95
replyGetDataMethod · 0.95
replyGetDelMethod · 0.95
replyGetTagsMethod · 0.95
replyGetCredsMethod · 0.95
replyGetAuxMethod · 0.95

Tested by

no test coverage detected