MCPcopy Index your code
hub / github.com/tinode/chat / pluginIDAndTopic

Function pluginIDAndTopic

server/plugins.go:719–751  ·  view source on GitHub ↗

pluginIDAndTopic extracts message ID and topic name.

(msg *ClientComMessage)

Source from the content-addressed store, hash-verified

717
718// pluginIDAndTopic extracts message ID and topic name.
719func pluginIDAndTopic(msg *ClientComMessage) (string, string) {
720 if msg.Hi != nil {
721 return msg.Hi.Id, ""
722 }
723 if msg.Acc != nil {
724 return msg.Acc.Id, ""
725 }
726 if msg.Login != nil {
727 return msg.Login.Id, ""
728 }
729 if msg.Sub != nil {
730 return msg.Sub.Id, msg.Sub.Topic
731 }
732 if msg.Leave != nil {
733 return msg.Leave.Id, msg.Leave.Topic
734 }
735 if msg.Pub != nil {
736 return msg.Pub.Id, msg.Pub.Topic
737 }
738 if msg.Get != nil {
739 return msg.Get.Id, msg.Get.Topic
740 }
741 if msg.Set != nil {
742 return msg.Set.Id, msg.Set.Topic
743 }
744 if msg.Del != nil {
745 return msg.Del.Id, msg.Del.Topic
746 }
747 if msg.Note != nil {
748 return "", msg.Note.Topic
749 }
750 return "", ""
751}

Callers 1

pluginFireHoseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…