Skip to main content

tuwunel_admin/room/moderation/
unban_room.rs

1use ruma::OwnedRoomOrAliasId;
2use tuwunel_core::Result;
3
4use crate::{admin_command, utils::room_enabled_reply};
5
6#[admin_command]
7pub(super) async fn unban_room(&self, room: OwnedRoomOrAliasId) -> Result {
8	let room_id = self.services.alias.maybe_resolve(&room).await?;
9
10	self.services.metadata.unban_room(&room_id);
11	self.services.metadata.enable_room(&room_id);
12
13	let message = room_enabled_reply(
14		self.services,
15		&room_id,
16		"Room unbanned and federation re-enabled.",
17		"Room unbanned",
18	)
19	.await;
20
21	self.write_str(&message).await
22}