MCPcopy Index your code
hub / github.com/dearcode/candy / send

Method send

store/postman.go:81–97  ·  view source on GitHub ↗

send 分发消息 1.检查是否存在好友关系或者群成员 2.添加到收件人消息列表中 3.调用notice接口Push通知

(pm meta.PushMessage)

Source from the content-addressed store, hash-verified

79// 2.添加到收件人消息列表中
80// 3.调用notice接口Push通知
81func (p *postman) send(pm meta.PushMessage) error {
82 log.Debugf("begin send msg:%v", pm)
83
84 if pm.Event == meta.Event_None {
85 if err := p.check(pm.Msg); err != nil {
86 log.Debugf("check error:%s", errors.ErrorStack(err))
87 return errors.Trace(err)
88 }
89 }
90
91 if pm.Msg.Group == 0 {
92 return p.sendToUser(pm)
93 }
94
95 return p.sendToGroup(pm)
96
97}

Callers

nothing calls this directly

Calls 3

checkMethod · 0.95
sendToUserMethod · 0.95
sendToGroupMethod · 0.95

Tested by

no test coverage detected