|
|
|
@ -108,16 +108,12 @@ 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 msg.SendID != v.UserID && (!v.OnlinePush) {
|
|
|
|
|
if err := callbackOfflinePush(ctx, userIDs, msg, &[]string{}); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
err = p.offlinePushMsg(ctx, userID, msg, userIDs)
|
|
|
|
|
err = p.offlinePushMsg(ctx, msg.SendID, msg, []string{v.UserID})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
@ -125,7 +121,6 @@ func (p *Pusher) Push2User(ctx context.Context, userIDs []string, msg *sdkws.Msg
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|