Ejemplo n.º 1
0
        public Task <SuccessOrError <Unit> > SwitchRoom(SwitchRoomDto dto)
        {
            var participant = GetContextParticipant();

            return(GetInvoker().Create(SetParticipantRoomRequest.MoveParticipant(participant, dto.RoomId))
                   .RequirePermissions(DefinedPermissions.Rooms.CanSwitchRoom).ValidateObject(dto).ConferenceMustBeOpen()
                   .Send());
        }
        public async Task Handle(ParticipantJoinedNotification notification, CancellationToken cancellationToken)
        {
            var participant = notification.Participant;

            try
            {
                await _mediator.Send(
                    SetParticipantRoomRequest.MoveParticipant(participant, RoomOptions.DEFAULT_ROOM_ID),
                    cancellationToken);
            }
            catch (ConcurrencyException e)
            {
                _logger.LogDebug(e,
                                 "The participant could not be assigned to the default room. Because the default room does not exist, the conference may be closed.");
            }
        }