From 675fe8347c37ff6d48def34107a0b238c88d13bc Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Tue, 14 May 2024 11:41:40 +0800 Subject: [PATCH] fix: notification has counted unread counts bug fix. --- .../msgtransfer/online_history_msg_handler.go | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go index 96747bde8..223ada5f4 100644 --- a/internal/msgtransfer/online_history_msg_handler.go +++ b/internal/msgtransfer/online_history_msg_handler.go @@ -147,20 +147,15 @@ func (och *OnlineHistoryRedisConsumerHandler) categorizeMessageLists(totalMsgs [ if v.message.Options != nil { msg.Options = msgprocessor.NewMsgOptions() } - if options.IsOfflinePush() { - v.message.Options = msgprocessor.WithOptions( - v.message.Options, - msgprocessor.WithOfflinePush(false), - ) - msg.Options = msgprocessor.WithOptions(msg.Options, msgprocessor.WithOfflinePush(true)) - } - if options.IsUnreadCount() { - v.message.Options = msgprocessor.WithOptions( - v.message.Options, - msgprocessor.WithUnreadCount(false), - ) - msg.Options = msgprocessor.WithOptions(msg.Options, msgprocessor.WithUnreadCount(true)) - } + msg.Options = msgprocessor.WithOptions(msg.Options, + msgprocessor.WithOfflinePush(options.IsOfflinePush()), + msgprocessor.WithUnreadCount(options.IsUnreadCount()), + ) + v.message.Options = msgprocessor.WithOptions( + v.message.Options, + msgprocessor.WithOfflinePush(false), + msgprocessor.WithUnreadCount(false), + ) ctxMsg := &ContextMsg{ message: msg, ctx: v.ctx,