Rework Room Deletion Handling

This commit is contained in:
Alan Moon 2025-07-06 10:38:08 -07:00
parent 14dd3273f9
commit 20cd48b131
2 changed files with 1 additions and 10 deletions

View File

@ -32,6 +32,7 @@ namespace qtc_api.Controllers
public async Task<ActionResult<ServiceResponse<Room>>> DeleteRoom(string roomId)
{
var response = await _roomService.DeleteRoom(roomId);
await _hubContext.Clients.Group(roomId).SendAsync("RoomDeleted");
await _hubContext.Clients.All.SendAsync("RefreshRoomList");
return Ok(response);
}

View File

@ -142,16 +142,6 @@ namespace qtc_api.Hubs
Log($"User {user.Username} Has Left {room.Name}");
}
[HubMethodName("HandleDeletedRoom")]
[Authorize]
public async Task HandleDeletedRoomAsync(Room room)
{
await Clients.Group(room.Id).SendAsync("RoomMessage", $"[SERVER] This Room Has Been Deleted By An Administrator.");
await Clients.Group(room.Id).SendAsync("cf", "rtl");
await Clients.All.SendAsync("RefreshRoomList");
}
[HubMethodName("SendMessage")]
[Authorize]
public async Task SendMessageAsync(User user, Message message, bool IsLobbyMsg, Room room = null!)