From 1a42f6dded3b8da24ea97b2dfd6746ec9651b9bb Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 6 Jun 2022 19:36:25 +0800 Subject: [PATCH] singal offline push --- pkg/common/db/newRedisModel.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/common/db/newRedisModel.go b/pkg/common/db/newRedisModel.go index f8808e4fd..04bcd28c7 100644 --- a/pkg/common/db/newRedisModel.go +++ b/pkg/common/db/newRedisModel.go @@ -140,6 +140,7 @@ func (d *DataBases) NewCacheSignalInfo(msg *pbCommon.MsgData) error { func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) { key := SignalCache + clientMsgID + invitationInfo = &pbRtc.SignalInviteReq{} bytes, err := d.rdb.Get(context.Background(), key).Bytes() if err != nil { return nil, err @@ -148,8 +149,12 @@ func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (inv if err = proto.Unmarshal(bytes, req); err != nil { return nil, err } - req2 := req.Payload.(*pbRtc.SignalReq_Invite) - invitationInfo = req2.Invite + switch req2 := req.Payload.(type) { + case *pbRtc.SignalReq_Invite: + invitationInfo.Invitation = req2.Invite.Invitation + case *pbRtc.SignalReq_InviteInGroup: + invitationInfo.Invitation = req2.InviteInGroup.Invitation + } return invitationInfo, err }