|
@@ -159,6 +159,13 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser |
|
|
return 0, err |
|
|
return 0, err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询接受者用户在线设备 |
|
|
|
|
|
receiverDevices, err := proxy.DeviceProxy.ListOnlineByUserId(ctx, req.ReceiverId) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
logger.Sugar.Error(err) |
|
|
|
|
|
return 0, err |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
isOpenAppPush := svc.SysCfgGet(masterId, "is_open_app_push") |
|
|
isOpenAppPush := svc.SysCfgGet(masterId, "is_open_app_push") |
|
|
utils.FilePutContents("SendToUser", utils.SerializeStr(map[string]interface{}{ |
|
|
utils.FilePutContents("SendToUser", utils.SerializeStr(map[string]interface{}{ |
|
|
"devices_len": len(devices), |
|
|
"devices_len": len(devices), |
|
@@ -168,7 +175,7 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser |
|
|
"req": req, |
|
|
"req": req, |
|
|
})) |
|
|
})) |
|
|
|
|
|
|
|
|
if len(devices) <= 0 { |
|
|
|
|
|
|
|
|
if len(receiverDevices) <= 0 { |
|
|
//isOpenAppPush := svc.SysCfgGet(masterId, "is_open_app_push") |
|
|
//isOpenAppPush := svc.SysCfgGet(masterId, "is_open_app_push") |
|
|
if sender.SenderType == pb.SenderType_ST_USER && req.ReceiverType == pb.ReceiverType_RT_USER && isOpenAppPush == "1" && req.ReceiverId != toUserId { |
|
|
if sender.SenderType == pb.SenderType_ST_USER && req.ReceiverType == pb.ReceiverType_RT_USER && isOpenAppPush == "1" && req.ReceiverId != toUserId { |
|
|
uid := strconv.FormatInt(req.ReceiverId, 10) |
|
|
uid := strconv.FormatInt(req.ReceiverId, 10) |
|
|