mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-11 23:47:32 +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)
|
||||
p.successCount++
|
||||
if isOfflinePush {
|
||||
for _, userID := range userIDs {
|
||||
if userID == msg.SendID {
|
||||
continue
|
||||
}
|
||||
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
|
||||
for _, v := range wsResults {
|
||||
if msg.SendID != v.UserID && (!v.OnlinePush) {
|
||||
if err := callbackOfflinePush(ctx, userIDs, msg, &[]string{}); err != nil {
|
||||
return err
|
||||
}
|
||||
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