From fafad9217d2660802dd14f39badae187c5a84f8e Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 4 Mar 2022 18:23:58 +0800 Subject: [PATCH] cb --- internal/rpc/msg/callback.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index f04c2a1fc..bb8ccd700 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -46,13 +46,14 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err erro if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut); err != nil { if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue { return false, err + } else { + return true, err } } else { if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { return false, nil } } - log.NewDebug(msg.OperationID, utils.GetSelfFuncName()) return true, err } @@ -93,13 +94,14 @@ func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackTimeOut); err != nil { if !config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue { return false, err + } else { + return true, err } } else { if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { return false, nil } } - log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), err.Error()) return true, err } @@ -141,6 +143,8 @@ func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { if !config.Config.Callback.CallbackWordFilter.CallbackFailedContinue { log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), "callback failed and config disable, stop this operation") return false, err + } else { + return true, err } } else { if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { @@ -151,6 +155,5 @@ func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { } log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) } - log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), err.Error()) return true, err }