msg destruct

test-v3dev1
wangchuxiao 1 year ago
parent c02f3cc8d5
commit 7059d6b5fb

@ -2,6 +2,7 @@ package msg
import ( import (
"context" "context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant" "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/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext" "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) { func (m *msgServer) SendMsg(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, error error) {
resp = &pbMsg.SendMsgResp{} resp = &pbMsg.SendMsgResp{}
if req.MsgData != nil {
flag := isMessageHasReadEnabled(req.MsgData) flag := isMessageHasReadEnabled(req.MsgData)
if !flag { if !flag {
return nil, errs.ErrMessageHasReadDisable.Wrap() return nil, errs.ErrMessageHasReadDisable.Wrap()
@ -31,6 +33,9 @@ func (m *msgServer) SendMsg(ctx context.Context, req *pbMsg.SendMsgReq) (resp *p
default: default:
return nil, errs.ErrArgs.Wrap("unknown sessionType") 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) { func (m *msgServer) sendMsgSuperGroupChat(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, err error) {

Loading…
Cancel
Save