push msg specify receiver

This commit is contained in:
Gordon
2022-02-08 17:12:02 +08:00
parent ba5d178ba0
commit dc1ad8fb2d
5 changed files with 115 additions and 103 deletions
+1 -7
View File
@@ -71,7 +71,7 @@ func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgRe
log.NewError(in.OperationID, "data encode err", err.Error())
}
var tag bool
recvID := in.MsgData.RecvID
recvID := in.PushToUserID
platformList := genPlatformArray()
for _, v := range platformList {
if conn := ws.getUserConn(recvID, v); conn != nil {
@@ -92,12 +92,6 @@ func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgRe
resp = append(resp, temp)
}
}
//Single chat sender synchronization message
if in.MsgData.GetSessionType() == constant.SingleChatType {
for k, v := range ws.getSingleUserAllConn(in.MsgData.SendID) {
_ = sendMsgToUser(v, replyBytes.Bytes(), in, k, in.MsgData.SendID)
}
}
if !tag {
log.NewError(in.OperationID, "push err ,no matched ws conn not in map", in.String())
}