msg destruct

This commit is contained in:
wangchuxiao
2023-07-10 14:47:07 +08:00
parent c02f3cc8d5
commit 7059d6b5fb
+5
View File
@@ -2,6 +2,7 @@ package msg
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"
@@ -16,6 +17,7 @@ import (
func (m *msgServer) SendMsg(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, error error) {
resp = &pbMsg.SendMsgResp{}
if req.MsgData != nil {
flag := isMessageHasReadEnabled(req.MsgData)
if !flag {
return nil, errs.ErrMessageHasReadDisable.Wrap()
@@ -31,6 +33,9 @@ func (m *msgServer) SendMsg(ctx context.Context, req *pbMsg.SendMsgReq) (resp *p
default:
return nil, errs.ErrArgs.Wrap("unknown sessionType")
}
} else {
return nil, errs.ErrArgs.Wrap("msgData is nil")
}
}
func (m *msgServer) sendMsgSuperGroupChat(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, err error) {