Room deletion (fixes #43)

This commit is contained in:
dasha_uwu committed 2025-08-28 23:28:20 +05:00
1 parent 7a3496869b
commit d05d3f710f
15 files changed
+447 -7

No files matched your search

+14
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(())
}
+5
View File
@@ -56,4 +56,9 @@ pub(super) enum RoomCommand {
Exists {
room_id: OwnedRoomId,
},
/// - Delete room
DeleteRoom {
room_id: OwnedRoomId,
},
}