mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-12 22:59:03 +08:00
callback add seq
This commit is contained in:
parent
9394d340a2
commit
f2a35fb833
@ -75,14 +75,14 @@ func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.M
|
||||
},
|
||||
UserIDList: userIDList,
|
||||
},
|
||||
OfflinePushInfo: msg.OfflinePushInfo,
|
||||
ClientMsgID: msg.ClientMsgID,
|
||||
SendID: msg.SendID,
|
||||
GroupID: msg.GroupID,
|
||||
ContentType: msg.ContentType,
|
||||
SessionType: msg.SessionType,
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
//OfflinePushInfo: msg.OfflinePushInfo,
|
||||
ClientMsgID: msg.ClientMsgID,
|
||||
SendID: msg.SendID,
|
||||
GroupID: msg.GroupID,
|
||||
ContentType: msg.ContentType,
|
||||
SessionType: msg.SessionType,
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
}
|
||||
resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackOnlinePushCommand, req, resp, config.Config.Callback.CallbackOnlinePush.CallbackTimeOut); err != nil {
|
||||
@ -97,9 +97,9 @@ func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.M
|
||||
}
|
||||
}
|
||||
if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow {
|
||||
if resp.OfflinePushInfo != nil {
|
||||
msg.OfflinePushInfo = resp.OfflinePushInfo
|
||||
}
|
||||
//if resp.OfflinePushInfo != nil {
|
||||
// msg.OfflinePushInfo = resp.OfflinePushInfo
|
||||
//}
|
||||
}
|
||||
return callbackResp
|
||||
}
|
||||
@ -117,15 +117,15 @@ func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg
|
||||
PlatformID: msg.SenderPlatformID,
|
||||
Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)),
|
||||
},
|
||||
OfflinePushInfo: msg.OfflinePushInfo,
|
||||
ClientMsgID: msg.ClientMsgID,
|
||||
SendID: msg.SendID,
|
||||
GroupID: groupID,
|
||||
ContentType: msg.ContentType,
|
||||
SessionType: msg.SessionType,
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
Seq: msg.Seq,
|
||||
//OfflinePushInfo: msg.OfflinePushInfo,
|
||||
ClientMsgID: msg.ClientMsgID,
|
||||
SendID: msg.SendID,
|
||||
GroupID: groupID,
|
||||
ContentType: msg.ContentType,
|
||||
SessionType: msg.SessionType,
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
Seq: msg.Seq,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSuperGroupOnlinePushResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackSuperGroupOnlinePushCommand, req, resp, config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.CallbackTimeOut); err != nil {
|
||||
@ -143,9 +143,9 @@ func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg
|
||||
if len(resp.UserIDList) != 0 {
|
||||
*pushToUserList = resp.UserIDList
|
||||
}
|
||||
if resp.OfflinePushInfo != nil {
|
||||
msg.OfflinePushInfo = resp.OfflinePushInfo
|
||||
}
|
||||
//if resp.OfflinePushInfo != nil {
|
||||
// msg.OfflinePushInfo = resp.OfflinePushInfo
|
||||
//}
|
||||
}
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), pushToUserList, resp.UserIDList)
|
||||
return callbackResp
|
||||
|
@ -10,15 +10,6 @@ import (
|
||||
)
|
||||
|
||||
func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
|
||||
//var tips sdk.TipsComm
|
||||
//var err error
|
||||
//marshaler := jsonpb.Marshaler{
|
||||
// OrigName: true,
|
||||
// EnumsAsInts: false,
|
||||
// EmitDefaults: false,
|
||||
//}
|
||||
//tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||
n := &NotificationMsg{
|
||||
SendID: sendID,
|
||||
RecvID: recvID,
|
||||
@ -27,11 +18,6 @@ func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
SessionType: constant.SingleChatType,
|
||||
OperationID: operationID,
|
||||
}
|
||||
//n.Content, err = proto.Marshal(&tips)
|
||||
//if err != nil {
|
||||
// log.NewError(operationID, utils.GetSelfFuncName(), "proto.Marshal failed")
|
||||
// return
|
||||
//}
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content))
|
||||
Notification(n)
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ type CallbackBeforePushResp struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeSuperGroupOnlinePushReq struct {
|
||||
*commonPb.OfflinePushInfo
|
||||
//*commonPb.OfflinePushInfo
|
||||
UserStatusBaseCallback
|
||||
ClientMsgID string `json:"clientMsgID"`
|
||||
SendID string `json:"sendID"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user