pull/168/head
Gordon 3 years ago
parent 341ec6e9a0
commit 9bbcf0c5d7

@ -43,7 +43,7 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err erro
} }
//utils.CopyStructFields(req, msg.MsgData) //utils.CopyStructFields(req, msg.MsgData)
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut); err != nil{ if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut); err != nil {
if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue { if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue {
return false, err return false, err
} }
@ -55,7 +55,6 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err erro
return true, err return true, err
} }
func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error {
if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable { if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable {
return nil return nil
@ -70,13 +69,12 @@ func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error {
resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}}
//utils.CopyStructFields(req, msg.MsgData) //utils.CopyStructFields(req, msg.MsgData)
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut); err != nil{ if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut); err != nil {
return err return err
} }
return nil return nil
} }
func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) {
if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable { if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable {
return true, nil return true, nil
@ -100,7 +98,7 @@ func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error
return false, nil return false, nil
} }
} }
log.NewInfo() //log.NewInfo()
return true, err return true, err
} }
@ -125,7 +123,6 @@ func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error {
return nil return nil
} }
func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) {
if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text { if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text {
return true, nil return true, nil
@ -156,8 +153,3 @@ func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) {
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), err.Error()) log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), err.Error())
return true, err return true, err
} }

Loading…
Cancel
Save