Room deletion (fixes #43)

This commit is contained in:
dasha_uwu
2025-08-22 20:21:05 +05:00
parent 7a3496869b
commit d05d3f710f
15 changed files with 447 additions and 7 deletions

View File

@@ -65,3 +65,17 @@ pub(super) async fn exists(&self, room_id: OwnedRoomId) -> Result {
self.write_str(&format!("{result}")).await
}
#[admin_command]
pub(super) async fn delete_room(&self, room_id: OwnedRoomId) -> Result {
if self.services.admin.is_admin_room(&room_id).await {
return Err!("Cannot delete admin room");
}
self.services.delete.delete_room(room_id).await?;
self.write_str("Successfully deleted the room from our database.")
.await?;
Ok(())
}

View File

@@ -56,4 +56,9 @@ pub(super) enum RoomCommand {
Exists {
room_id: OwnedRoomId,
},
/// - Delete room
DeleteRoom {
room_id: OwnedRoomId,
},
}