test-errcode
withchao 2 years ago
parent 5061047164
commit 9b271da739

@ -3,6 +3,7 @@ package msgtransfer
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"errors"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
@ -76,8 +77,17 @@ func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(ctx context.Cont
log.ZError(ctx, "json.Unmarshal RevokeMsgTips", err, "content", string(v.Content)) log.ZError(ctx, "json.Unmarshal RevokeMsgTips", err, "content", string(v.Content))
continue continue
} }
v.Seq = tips.Seq msgs, err := mc.msgDatabase.GetMsgBySeqs(ctx, tips.ConversationID, []int64{tips.Seq})
data, err := proto.Marshal(v) if err != nil {
log.ZError(ctx, "GetMsgBySeqs", err, "conversationID", tips.ConversationID, "seq", tips.Seq)
continue
}
if len(msgs) == 0 {
log.ZError(ctx, "GetMsgBySeqs empty", errors.New("seq not found"), "conversationID", tips.ConversationID, "seq", tips.Seq)
continue
}
msgs[0].Content = []byte(elem.Detail)
data, err := proto.Marshal(msgs[0])
if err != nil { if err != nil {
log.ZError(ctx, "proto.Marshal MsgData", err) log.ZError(ctx, "proto.Marshal MsgData", err)
continue continue

Loading…
Cancel
Save