|
|
|
@ -159,6 +159,9 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|
|
|
|
}
|
|
|
|
|
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackResp: ", callbackResp)
|
|
|
|
|
if callbackResp.ActionCode != constant.ActionAllow {
|
|
|
|
|
if callbackResp.ErrCode == 0 {
|
|
|
|
|
callbackResp.ErrCode = 201
|
|
|
|
|
}
|
|
|
|
|
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter result", "end rpc and return", pb.MsgData)
|
|
|
|
|
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
|
|
|
|
}
|
|
|
|
@ -170,8 +173,11 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|
|
|
|
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg resp: ", callbackResp)
|
|
|
|
|
}
|
|
|
|
|
if callbackResp.ActionCode != constant.ActionAllow {
|
|
|
|
|
if callbackResp.ErrCode == 0 {
|
|
|
|
|
callbackResp.ErrCode = 201
|
|
|
|
|
}
|
|
|
|
|
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp)
|
|
|
|
|
return returnMsg(&replay, pb, int32(callbackResp.ActionCode), callbackResp.ErrMsg, "", 0)
|
|
|
|
|
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
|
|
|
|
}
|
|
|
|
|
isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb)
|
|
|
|
|
if isSend {
|
|
|
|
@ -203,8 +209,11 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|
|
|
|
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg resp:", callbackResp)
|
|
|
|
|
}
|
|
|
|
|
if callbackResp.ActionCode != constant.ActionAllow {
|
|
|
|
|
if callbackResp.ErrCode == 0 {
|
|
|
|
|
callbackResp.ErrCode = 201
|
|
|
|
|
}
|
|
|
|
|
log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp)
|
|
|
|
|
return returnMsg(&replay, pb, int32(callbackResp.ActionCode), callbackResp.ErrMsg, "", 0)
|
|
|
|
|
return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0)
|
|
|
|
|
}
|
|
|
|
|
getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pb.OperationID, GroupID: pb.MsgData.GroupID}
|
|
|
|
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName)
|
|
|
|
|