From 63f47570717fd324acf412db21c4edd12f8d6654 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 12 May 2023 20:50:14 +0800 Subject: [PATCH] notification --- internal/rpc/conversation/conversaion.go | 2 -- internal/rpc/msg/server.go | 1 + pkg/utils/utils.go | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index ed479e22f..33a17f12a 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -10,7 +10,6 @@ import ( "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation" tableRelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/tx" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry" "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation" @@ -220,7 +219,6 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbConver return nil, err } for _, ownerUserID := range req.UserIDs { - log.ZDebug(ctx, "set private", "sendID", ownerUserID, "recvID", req.Conversation.UserID) c.conversationNotificationSender.ConversationSetPrivateNotification(ctx, ownerUserID, req.Conversation.UserID, req.Conversation.IsPrivateChat.Value) } } diff --git a/internal/rpc/msg/server.go b/internal/rpc/msg/server.go index 91c37041a..f49461c1d 100644 --- a/internal/rpc/msg/server.go +++ b/internal/rpc/msg/server.go @@ -134,6 +134,7 @@ func (m *msgServer) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sd for _, conversationID := range conversationIDs { conversationIDs = append(conversationIDs, utils.GetNotificationConvetstionID(conversationID)) } + conversationIDs = append(conversationIDs, utils.GetSelfNotificationConversationID(req.UserID)...) log.ZDebug(ctx, "GetMaxSeq", "conversationIDs", conversationIDs) maxSeqs, err := m.MsgDatabase.GetMaxSeqs(ctx, conversationIDs) if err != nil { diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 61572db9e..4e28b631c 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -248,6 +248,10 @@ func GetNotificationConvetstionID(conversationID string) string { return "" } +func GetSelfNotificationConversationID(userID string) []string { + return []string{"n_" + userID + "_" + userID, "si_" + userID + "_" + userID} +} + type MsgBySeq []*sdkws.MsgData func (s MsgBySeq) Len() int {