callback add offline info

This commit is contained in:
Gordon
2022-08-19 13:04:38 +08:00
parent 40b7314f6d
commit 9a82dd356c
3 changed files with 27 additions and 7 deletions
+8 -3
View File
@@ -12,7 +12,7 @@ import (
http2 "net/http"
)
func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData, offlinePushUserIDList *[]string) cbApi.CommonCallbackResp {
func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.MsgData, offlinePushUserIDList *[]string, offlineInfo *commonPb.OfflinePushInfo) cbApi.CommonCallbackResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
if !config.Config.Callback.CallbackOfflinePush.Enable {
return callbackResp
@@ -47,8 +47,13 @@ func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.
return callbackResp
}
}
if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow && len(resp.UserIDList) != 0 {
*offlinePushUserIDList = resp.UserIDList
if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow {
if len(resp.UserIDList) != 0 {
*offlinePushUserIDList = resp.UserIDList
}
if resp.OfflinePushInfo != nil {
*offlineInfo = *resp.OfflinePushInfo
}
}
log.NewDebug(operationID, utils.GetSelfFuncName(), offlinePushUserIDList, resp.UserIDList)
return callbackResp