Skip to content

Commit

Permalink
fix: single chat offline push webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
storyn26383 committed Nov 19, 2024
1 parent da040b1 commit 8d8627e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions internal/push/push_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,21 @@ func (c *ConsumerHandler) Push2User(ctx context.Context, userIDs []string, msg *
return nil
}
}
offlinePushUserID := []string{msg.RecvID}
needOfflinePushUserID := []string{msg.RecvID}
var offlinePushUserID []string

//receiver offline push
if err = c.webhookBeforeOfflinePush(ctx, &c.config.WebhooksConfig.BeforeOfflinePush,
offlinePushUserID, msg, nil); err != nil {
if err = c.webhookBeforeOfflinePush(ctx, &c.config.WebhooksConfig.BeforeOfflinePush, needOfflinePushUserID, msg, &offlinePushUserID); err != nil {
return err
}
log.ZInfo(ctx, "webhookBeforeOfflinePush end")
err = c.offlinePushMsg(ctx, msg, offlinePushUserID)

if len(offlinePushUserID) > 0 {
needOfflinePushUserID = offlinePushUserID
}
err = c.offlinePushMsg(ctx, msg, needOfflinePushUserID)
if err != nil {
log.ZWarn(ctx, "offlinePushMsg failed", err, "offlinePushUserID", offlinePushUserID, "msg", msg)
log.ZWarn(ctx, "offlinePushMsg failed", err, "needOfflinePushUserID", needOfflinePushUserID, "msg", msg)
return nil
}

Expand Down

0 comments on commit 8d8627e

Please sign in to comment.