From 340ce42b17122f228a2d962b2493ee8da8eb25af Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Thu, 27 Jul 2023 20:27:05 +0800 Subject: [PATCH] fix bug: reject group req bug --- internal/rpc/group/group.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 4ce3d4216..65beae37e 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -17,14 +17,15 @@ package group import ( "context" "fmt" - "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" "math/big" "math/rand" "strconv" "strings" "time" + "github.com/OpenIMSDK/Open-IM-Server/pkg/authverify" + "github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor" + pbConversation "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/protocol/wrapperspb" @@ -718,11 +719,11 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup if err := s.GroupDatabase.HandlerGroupRequest(ctx, req.GroupID, req.FromUserID, req.HandledMsg, req.HandleResult, member); err != nil { return nil, err } - if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, []string{req.FromUserID}); err != nil { - return nil, err - } switch req.HandleResult { case constant.GroupResponseAgree: + if err := s.conversationRpcClient.GroupChatFirstCreateConversation(ctx, req.GroupID, []string{req.FromUserID}); err != nil { + return nil, err + } s.Notification.GroupApplicationAcceptedNotification(ctx, req) case constant.GroupResponseRefuse: s.Notification.GroupApplicationRejectedNotification(ctx, req)