Delete v2 signalling (#3835)
* Delete v2 signalling * deps * mage generate * deelte unused file
This commit is contained in:
@@ -194,57 +194,3 @@ func (r whipParticipantService) DeleteSession(ctx context.Context, req *rpc.WHIP
|
||||
}
|
||||
|
||||
// --------------------------------
|
||||
|
||||
type signalv2ParticipantService struct {
|
||||
*RoomManager
|
||||
}
|
||||
|
||||
func (s signalv2ParticipantService) RelaySignalv2Participant(ctx context.Context, req *rpc.RelaySignalv2ParticipantRequest) (*rpc.RelaySignalv2ParticipantResponse, error) {
|
||||
room := s.RoomManager.GetRoom(ctx, livekit.RoomName(req.Room))
|
||||
if room == nil {
|
||||
return nil, ErrRoomNotFound
|
||||
}
|
||||
|
||||
lp := room.GetParticipantByID(livekit.ParticipantID(req.ParticipantId))
|
||||
if lp == nil {
|
||||
return nil, ErrParticipantNotFound
|
||||
}
|
||||
|
||||
err := lp.HandleSignalMessage(req.WireMessage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var wireMessage *livekit.Signalv2WireMessage
|
||||
if pending := lp.SignalPendingMessages(); pending != nil {
|
||||
var ok bool
|
||||
if wireMessage, ok = pending.(*livekit.Signalv2WireMessage); !ok {
|
||||
return nil, ErrInvalidMessageType
|
||||
}
|
||||
}
|
||||
|
||||
return &rpc.RelaySignalv2ParticipantResponse{
|
||||
WireMessage: wireMessage,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s signalv2ParticipantService) RelaySignalv2ParticipantDeleteSession(
|
||||
ctx context.Context,
|
||||
req *rpc.RelaySignalv2ParticipantDeleteSessionRequest,
|
||||
) (*emptypb.Empty, error) {
|
||||
room := s.RoomManager.GetRoom(ctx, livekit.RoomName(req.Room))
|
||||
if room == nil {
|
||||
return nil, ErrRoomNotFound
|
||||
}
|
||||
|
||||
lp := room.GetParticipantByID(livekit.ParticipantID(req.ParticipantId))
|
||||
if lp != nil {
|
||||
room.RemoveParticipant(
|
||||
lp.Identity(),
|
||||
lp.ID(),
|
||||
types.ParticipantCloseReasonClientRequestLeave,
|
||||
)
|
||||
}
|
||||
|
||||
return &emptypb.Empty{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user