2024-07-27 00:11:41 +00:00
|
|
|
mod alias;
|
|
|
|
|
mod commands;
|
|
|
|
|
mod directory;
|
|
|
|
|
mod info;
|
|
|
|
|
mod moderation;
|
2024-06-16 22:26:52 +00:00
|
|
|
|
2024-04-20 19:55:14 -04:00
|
|
|
use clap::Subcommand;
|
2024-06-16 22:26:52 +00:00
|
|
|
use conduit::Result;
|
2024-08-08 17:18:30 +00:00
|
|
|
use ruma::OwnedRoomId;
|
2024-04-20 19:55:14 -04:00
|
|
|
|
2024-07-27 00:11:41 +00:00
|
|
|
use self::{
|
|
|
|
|
alias::RoomAliasCommand, directory::RoomDirectoryCommand, info::RoomInfoCommand, moderation::RoomModerationCommand,
|
|
|
|
|
};
|
|
|
|
|
use crate::admin_command_dispatch;
|
2024-04-20 19:55:14 -04:00
|
|
|
|
2024-07-27 00:11:41 +00:00
|
|
|
#[admin_command_dispatch]
|
2024-07-24 00:13:03 +00:00
|
|
|
#[derive(Debug, Subcommand)]
|
2024-06-16 22:26:52 +00:00
|
|
|
pub(super) enum RoomCommand {
|
2024-04-20 19:55:14 -04:00
|
|
|
/// - List all rooms the server knows about
|
2024-07-27 00:11:41 +00:00
|
|
|
#[clap(alias = "list")]
|
|
|
|
|
ListRooms {
|
2024-04-20 19:55:14 -04:00
|
|
|
page: Option<usize>,
|
2024-07-07 15:18:07 -04:00
|
|
|
|
|
|
|
|
/// Excludes rooms that we have federation disabled with
|
|
|
|
|
#[arg(long)]
|
|
|
|
|
exclude_disabled: bool,
|
|
|
|
|
|
|
|
|
|
/// Excludes rooms that we have banned
|
|
|
|
|
#[arg(long)]
|
|
|
|
|
exclude_banned: bool,
|
2024-09-01 00:56:49 -04:00
|
|
|
|
|
|
|
|
#[arg(long)]
|
|
|
|
|
/// Whether to only output room IDs without supplementary room
|
|
|
|
|
/// information
|
|
|
|
|
no_details: bool,
|
2024-04-20 19:55:14 -04:00
|
|
|
},
|
|
|
|
|
|
2024-06-10 22:54:55 -04:00
|
|
|
#[command(subcommand)]
|
|
|
|
|
/// - View information about a room we know about
|
|
|
|
|
Info(RoomInfoCommand),
|
|
|
|
|
|
2024-04-20 19:55:14 -04:00
|
|
|
#[command(subcommand)]
|
|
|
|
|
/// - Manage moderation of remote or local rooms
|
|
|
|
|
Moderation(RoomModerationCommand),
|
|
|
|
|
|
|
|
|
|
#[command(subcommand)]
|
|
|
|
|
/// - Manage rooms' aliases
|
|
|
|
|
Alias(RoomAliasCommand),
|
|
|
|
|
|
|
|
|
|
#[command(subcommand)]
|
|
|
|
|
/// - Manage the room directory
|
|
|
|
|
Directory(RoomDirectoryCommand),
|
2024-08-08 17:18:30 +00:00
|
|
|
|
|
|
|
|
/// - Check if we know about a room
|
|
|
|
|
Exists {
|
|
|
|
|
room_id: OwnedRoomId,
|
|
|
|
|
},
|
2024-04-20 19:55:14 -04:00
|
|
|
}
|