Skip to main content

tuwunel_admin/room/
mod.rs

1mod alias;
2mod commands;
3mod directory;
4mod info;
5mod moderation;
6
7use clap::Subcommand;
8use ruma::OwnedRoomId;
9use tuwunel_core::Result;
10
11use self::{
12	alias::RoomAliasCommand, directory::RoomDirectoryCommand, info::RoomInfoCommand,
13	moderation::RoomModerationCommand,
14};
15use crate::admin_command_dispatch;
16
17#[admin_command_dispatch(handler_prefix = "room")]
18#[derive(Debug, Subcommand)]
19pub(super) enum RoomCommand {
20	/// - List all rooms the server knows about
21	List {
22		page: Option<usize>,
23
24		/// Excludes rooms that we have federation disabled with
25		#[arg(long)]
26		exclude_disabled: bool,
27
28		/// Excludes rooms that we have banned
29		#[arg(long)]
30		exclude_banned: bool,
31
32		#[arg(long)]
33		/// Whether to only output room IDs without supplementary room
34		/// information
35		no_details: bool,
36	},
37
38	#[command(subcommand)]
39	/// - View information about a room we know about
40	Info(RoomInfoCommand),
41
42	#[command(subcommand)]
43	/// - Manage moderation of remote or local rooms
44	Moderation(RoomModerationCommand),
45
46	#[command(subcommand)]
47	/// - Manage room aliases
48	Alias(RoomAliasCommand),
49
50	#[command(subcommand)]
51	/// - Manage the room directory
52	Directory(RoomDirectoryCommand),
53
54	/// - Check if we know about a room
55	Exists {
56		room_id: OwnedRoomId,
57	},
58
59	/// - Delete room
60	Delete {
61		room_id: OwnedRoomId,
62
63		#[arg(short, long)]
64		force: bool,
65	},
66
67	/// - Prune empty rooms
68	PruneEmpty {
69		#[arg(short, long)]
70		force: bool,
71	},
72}