From 641ac7c503461522356ba187bc22c0a2ff7bacd2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 16:32:18 +0800 Subject: [PATCH 1/3] sdk update --- cmd/Open-IM-SDK-Core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index c5e258fa8..1667b0f4e 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit c5e258fa82dd11c9ca1e553a56920bad3f1a4b73 +Subproject commit 1667b0f4e205fc4ed7c690ab55b662087d61c277 From 14d5b3b316b9b751a87cd221798b6a6b56625ae6 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 18:47:06 +0800 Subject: [PATCH 2/3] remove validation for notificationFaceURL --- internal/api/manage/management_chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index c7837c5c9..7a1876c83 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -460,7 +460,7 @@ type RevokeElem struct { } type OANotificationElem struct { NotificationName string `mapstructure:"notificationName" json:"notificationName" validate:"required"` - NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL" validate:"required"` + NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL"` NotificationType int32 `mapstructure:"notificationType" json:"notificationType" validate:"required"` Text string `mapstructure:"text" json:"text" validate:"required"` Url string `mapstructure:"url" json:"url"` From 5a626e9dabd0ddcd609aaa1f67ee32e9a6c46b3e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 26 Jul 2022 21:02:11 +0800 Subject: [PATCH 3/3] 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 f1fa4fb78..b638b8c5f 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -636,7 +636,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 9ea7efcc0..77fc58e63 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 8c6c45ec0..3edcd0f21 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -252,6 +252,7 @@ const ( FieldGroupAtType = 5 FieldIsNotInGroup = 6 FieldEx = 7 + FieldUnread = 8 ) const (