From e49e3475b24b38863047ee3e3a8e66bd211b6680 Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:05:54 +0800 Subject: [PATCH] fix: pull message set isRead only message come from single. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> --- pkg/common/convert/msg.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/common/convert/msg.go b/pkg/common/convert/msg.go index 59070d338..d3d2d25e7 100644 --- a/pkg/common/convert/msg.go +++ b/pkg/common/convert/msg.go @@ -15,6 +15,7 @@ package convert import ( + "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation" @@ -78,7 +79,9 @@ func MsgDB2Pb(msgModel *unrelation.MsgDataModel) *sdkws.MsgData { msg.SendTime = msgModel.SendTime msg.CreateTime = msgModel.CreateTime msg.Status = msgModel.Status - msg.IsRead = msgModel.IsRead + if msgModel.SessionType == constant.SingleChatType { + msg.IsRead = msgModel.IsRead + } msg.Options = msgModel.Options if msgModel.OfflinePush != nil { msg.OfflinePushInfo = &sdkws.OfflinePushInfo{