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

Method handleClientMsg

server/topic.go:621–630  ·  view source on GitHub ↗

handleClientMsg is the top-level handler of messages received by the topic from sessions.

(msg *ClientComMessage)

Source from the content-addressed store, hash-verified

619
620// handleClientMsg is the top-level handler of messages received by the topic from sessions.
621func (t *Topic) handleClientMsg(msg *ClientComMessage) {
622 if msg.Pub != nil {
623 t.handlePubBroadcast(msg)
624 } else if msg.Note != nil {
625 t.handleNoteBroadcast(msg)
626 } else {
627 // TODO(gene): maybe remove this panic.
628 logs.Err.Panic("topic: wrong client message type for broadcasting", t.name)
629 }
630}
631
632// handleServerMsg is the top-level handler of messages generated at the server.
633func (t *Topic) handleServerMsg(msg *ServerComMessage) {

Calls 2

handlePubBroadcastMethod · 0.95
handleNoteBroadcastMethod · 0.95