send 分发消息 1.检查是否存在好友关系或者群成员 2.添加到收件人消息列表中 3.调用notice接口Push通知
(pm meta.PushMessage)
| 79 | // 2.添加到收件人消息列表中 |
| 80 | // 3.调用notice接口Push通知 |
| 81 | func (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 | } |
nothing calls this directly
no test coverage detected