mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-11 23:47:32 +08:00
Merge d244060e594165a7b11e1f13e26d6b79cfbc5160 into b8c4b459fa541205dbdaf32974d63f7ac78b5406
This commit is contained in:
commit
35907afad8
@ -152,20 +152,17 @@ func (s *Server) pushToUser(ctx context.Context, userID string, msgData *sdkws.M
|
|||||||
userPlatform := &msggateway.SingleMsgToUserPlatform{
|
userPlatform := &msggateway.SingleMsgToUserPlatform{
|
||||||
RecvPlatFormID: int32(client.PlatformID),
|
RecvPlatFormID: int32(client.PlatformID),
|
||||||
}
|
}
|
||||||
if !client.IsBackground ||
|
if client.IsBackground && client.PlatformID == constant.IOSPlatformID {
|
||||||
(client.IsBackground && client.PlatformID != constant.IOSPlatformID) {
|
userPlatform.ResultCode = int64(servererrs.ErrIOSBackgroundPushErr.Code())
|
||||||
err := client.PushMessage(ctx, msgData)
|
result.Resp = append(result.Resp, userPlatform)
|
||||||
if err != nil {
|
continue
|
||||||
|
}
|
||||||
|
if err := client.PushMessage(ctx, msgData); err != nil {
|
||||||
log.ZWarn(ctx, "online push msg failed", err, "userID", userID, "platformID", client.PlatformID)
|
log.ZWarn(ctx, "online push msg failed", err, "userID", userID, "platformID", client.PlatformID)
|
||||||
userPlatform.ResultCode = int64(servererrs.ErrPushMsgErr.Code())
|
userPlatform.ResultCode = int64(servererrs.ErrPushMsgErr.Code())
|
||||||
} else {
|
} else if _, ok := s.pushTerminal[client.PlatformID]; ok {
|
||||||
if _, ok := s.pushTerminal[client.PlatformID]; ok {
|
|
||||||
result.OnlinePush = true
|
result.OnlinePush = true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
userPlatform.ResultCode = int64(servererrs.ErrIOSBackgroundPushErr.Code())
|
|
||||||
}
|
|
||||||
result.Resp = append(result.Resp, userPlatform)
|
result.Resp = append(result.Resp, userPlatform)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user