mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-13 16:47:36 +08:00
fix: user offline push
This commit is contained in:
parent
e76ffef473
commit
05e887a78f
@ -108,21 +108,16 @@ func (p *Pusher) Push2User(ctx context.Context, userIDs []string, msg *sdkws.Msg
|
|||||||
log.ZDebug(ctx, "push_result", "ws push result", wsResults, "sendData", msg, "isOfflinePush", isOfflinePush, "push_to_userID", userIDs)
|
log.ZDebug(ctx, "push_result", "ws push result", wsResults, "sendData", msg, "isOfflinePush", isOfflinePush, "push_to_userID", userIDs)
|
||||||
p.successCount++
|
p.successCount++
|
||||||
if isOfflinePush {
|
if isOfflinePush {
|
||||||
for _, userID := range userIDs {
|
for _, v := range wsResults {
|
||||||
if userID == msg.SendID {
|
if msg.SendID != v.UserID && (!v.OnlinePush) {
|
||||||
continue
|
if err := callbackOfflinePush(ctx, userIDs, msg, &[]string{}); err != nil {
|
||||||
}
|
return err
|
||||||
for _, v := range wsResults {
|
|
||||||
if userID == v.UserID && (!v.OnlinePush) {
|
|
||||||
if err := callbackOfflinePush(ctx, userIDs, msg, &[]string{}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = p.offlinePushMsg(ctx, userID, msg, userIDs)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
err = p.offlinePushMsg(ctx, msg.SendID, msg, []string{v.UserID})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user