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-12-14 21:58:01 -05:00
|
|
|
use conduwuit::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::{
|
2024-12-15 00:05:47 -05:00
|
|
|
alias::RoomAliasCommand, directory::RoomDirectoryCommand, info::RoomInfoCommand,
|
|
|
|
|
moderation::RoomModerationCommand,
|
2024-07-27 00:11:41 +00:00
|
|
|
};
|
|
|
|
|
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)]
|
2025-05-24 00:28:09 +01:00
|
|
|
pub enum RoomCommand {
|
2026-01-12 10:47:19 -05: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
|
|
|
|
2026-02-15 21:25:59 +00:00
|
|
|
/// Includes disconnected/empty rooms (rooms with zero members)
|
|
|
|
|
#[arg(long)]
|
|
|
|
|
include_empty: 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)]
|
2026-01-12 10:47:19 -05:00
|
|
|
/// View information about a room we know about
|
2024-06-10 22:54:55 -04:00
|
|
|
Info(RoomInfoCommand),
|
|
|
|
|
|
2024-04-20 19:55:14 -04:00
|
|
|
#[command(subcommand)]
|
2026-01-12 10:47:19 -05:00
|
|
|
/// Manage moderation of remote or local rooms
|
2024-04-20 19:55:14 -04:00
|
|
|
Moderation(RoomModerationCommand),
|
|
|
|
|
|
|
|
|
|
#[command(subcommand)]
|
2026-01-12 10:47:19 -05:00
|
|
|
/// Manage rooms' aliases
|
2024-04-20 19:55:14 -04:00
|
|
|
Alias(RoomAliasCommand),
|
|
|
|
|
|
|
|
|
|
#[command(subcommand)]
|
2026-01-12 10:47:19 -05:00
|
|
|
/// Manage the room directory
|
2024-04-20 19:55:14 -04:00
|
|
|
Directory(RoomDirectoryCommand),
|
2024-08-08 17:18:30 +00:00
|
|
|
|
2026-01-12 10:47:19 -05:00
|
|
|
/// Check if we know about a room
|
2024-08-08 17:18:30 +00:00
|
|
|
Exists {
|
|
|
|
|
room_id: OwnedRoomId,
|
|
|
|
|
},
|
2024-04-20 19:55:14 -04:00
|
|
|
}
|