chore: package path changes

Signed-off-by: withchao <993506633@qq.com>
This commit is contained in:
withchao
2023-07-26 17:23:35 +08:00
parent f4c31ea09a
commit ac14dd0249
7 changed files with 17 additions and 366 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ package conversation
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
"google.golang.org/grpc"
@@ -197,7 +198,7 @@ func (c *conversationServer) GetRecvMsgNotNotifyUserIDs(ctx context.Context, req
// create conversation without notification for msg redis transfer.
func (c *conversationServer) CreateSingleChatConversations(ctx context.Context, req *pbConversation.CreateSingleChatConversationsReq) (*pbConversation.CreateSingleChatConversationsResp, error) {
var conversation tableRelation.ConversationModel
conversation.ConversationID = utils.GetConversationIDBySessionType(constant.SingleChatType, req.RecvID, req.SendID)
conversation.ConversationID = msgprocessor.GetConversationIDBySessionType(constant.SingleChatType, req.RecvID, req.SendID)
conversation.ConversationType = constant.SingleChatType
conversation.OwnerUserID = req.SendID
conversation.UserID = req.RecvID
+3 -2
View File
@@ -17,6 +17,7 @@ package group
import (
"context"
"fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
"math/big"
"math/rand"
"strconv"
@@ -829,7 +830,7 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
}
func (s *groupServer) deleteMemberAndSetConversationSeq(ctx context.Context, groupID string, userIDs []string) error {
conevrsationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
conevrsationID := msgprocessor.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
maxSeq, err := s.msgRpcClient.GetConversationMaxSeq(ctx, conevrsationID)
if err != nil {
return err
@@ -889,7 +890,7 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
go func() {
nctx := mcontext.NewCtx("@@@" + mcontext.GetOperationID(ctx))
conversation := &pbConversation.ConversationReq{
ConversationID: utils.GetConversationIDBySessionType(constant.SuperGroupChatType, req.GroupInfoForSet.GroupID),
ConversationID: msgprocessor.GetConversationIDBySessionType(constant.SuperGroupChatType, req.GroupInfoForSet.GroupID),
ConversationType: constant.SuperGroupChatType,
GroupID: req.GroupInfoForSet.GroupID,
}
+4 -3
View File
@@ -16,6 +16,7 @@ package msg
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
promePkg "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
"github.com/OpenIMSDK/protocol/constant"
@@ -90,7 +91,7 @@ func (m *msgServer) setConversationAtInfo(nctx context.Context, msg *sdkws.MsgDa
ctx := mcontext.NewCtx("@@@" + mcontext.GetOperationID(nctx))
var atUserID []string
conversation := &pbConversation.ConversationReq{
ConversationID: utils.GetConversationIDByMsg(msg),
ConversationID: msgprocessor.GetConversationIDByMsg(msg),
ConversationType: msg.SessionType,
GroupID: msg.GroupID,
}
@@ -148,8 +149,8 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *pbMsg.SendMsgReq
if err := m.messageVerification(ctx, req); err != nil {
return nil, err
}
var isSend bool = true
isNotification := utils.IsNotificationByMsg(req.MsgData)
var isSend = true
isNotification := msgprocessor.IsNotificationByMsg(req.MsgData)
if !isNotification {
isSend, err = m.modifyMessageByUserMessageReceiveOpt(
ctx,
+2 -1
View File
@@ -16,6 +16,7 @@ package msg
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
"github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/protocol/msg"
@@ -34,7 +35,7 @@ func (m *msgServer) PullMessageBySeqs(
resp.Msgs = make(map[string]*sdkws.PullMsgs)
resp.NotificationMsgs = make(map[string]*sdkws.PullMsgs)
for _, seq := range req.SeqRanges {
if !utils.IsNotification(seq.ConversationID) {
if !msgprocessor.IsNotification(seq.ConversationID) {
conversation, err := m.Conversation.GetConversation(ctx, req.UserID, seq.ConversationID)
if err != nil {
log.ZError(ctx, "GetConversation error", err, "conversationID", seq.ConversationID)