mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
singal offline push
This commit is contained in:
parent
409a8311b1
commit
2b25fea86c
@ -125,6 +125,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
||||
if err != nil {
|
||||
log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error())
|
||||
}
|
||||
log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), "opts:", opts)
|
||||
pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID, opts)
|
||||
if err != nil {
|
||||
log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error())
|
||||
@ -141,11 +142,11 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
||||
|
||||
func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err error) {
|
||||
if pushMsg.MsgData.ContentType < constant.SignalingNotificationEnd && pushMsg.MsgData.ContentType > constant.SignalingNotification {
|
||||
req := &pbRtc.SignalMessageAssembleReq{}
|
||||
req := &pbRtc.SignalReq{}
|
||||
if err := proto.Unmarshal(pushMsg.MsgData.Content, req); err != nil {
|
||||
return opts, err
|
||||
}
|
||||
switch req.SignalReq.Payload.(type) {
|
||||
switch req.Payload.(type) {
|
||||
case *pbRtc.SignalReq_Invite, *pbRtc.SignalReq_InviteInGroup:
|
||||
opts.Signal.ClientMsgID = pushMsg.MsgData.ClientMsgID
|
||||
}
|
||||
|
@ -356,14 +356,15 @@ func (d *DataBases) CacheSignalInfo(msg *pbCommon.MsgData) error {
|
||||
func (d *DataBases) GetSignalInfoFromCache(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
|
||||
key := SignalCache + clientMsgID
|
||||
result, err := redis.Bytes(d.Exec("GET", key))
|
||||
log2.NewDebug("", utils.GetSelfFuncName(), clientMsgID, result)
|
||||
log2.NewDebug("", utils.GetSelfFuncName(), clientMsgID, result, string(result))
|
||||
if err != nil {
|
||||
invitationInfo := &pbRtc.SignalInviteReq{}
|
||||
return invitationInfo, err
|
||||
return nil, err
|
||||
}
|
||||
req := &pbRtc.SignalMessageAssembleReq{}
|
||||
err = proto.Unmarshal(result, req)
|
||||
req2 := req.SignalReq.Payload.(*pbRtc.SignalReq_Invite)
|
||||
req := &pbRtc.SignalReq{}
|
||||
if err = proto.Unmarshal(result, req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req2 := req.Payload.(*pbRtc.SignalReq_Invite)
|
||||
invitationInfo = req2.Invite
|
||||
return invitationInfo, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user