From 5e5654f5136d37848a0cf377802536b99698c31e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 21:02:11 +0800 Subject: [PATCH] add update conversation unread count --- config/config.yaml | 2 +- internal/rpc/conversation/conversaion.go | 3 +++ pkg/common/constant/constant.go | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 3b3483b0a..991f3230a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -603,7 +603,7 @@ notification: #####################conversation######################### conversationOptUpdate: conversation: - reliabilityLevel: 2 + reliabilityLevel: 1 unreadCount: false offlinePush: switch: true diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 7012e0924..6f79d89df 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -70,6 +70,9 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"ex": conversation.Ex}) case constant.FieldAttachedInfo: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo}) + case constant.FieldUnread: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"unread_count": conversation.UnreadCount}) + } if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateColumnsConversations error", err.Error()) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 97746a294..256ecc32e 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -217,6 +217,7 @@ const ( FieldGroupAtType = 5 FieldIsNotInGroup = 6 FieldEx = 7 + FieldUnread = 8 ) const (