Files
continuwuity/src/admin/room/mod.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.2 KiB
Rust
Raw Normal View History

2024-07-27 00:11:41 +00:00
mod alias;
mod commands;
mod directory;
mod info;
mod moderation;
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::{
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]
#[derive(Debug, Subcommand)]
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>,
/// Excludes rooms that we have federation disabled with
#[arg(long)]
exclude_disabled: bool,
/// Excludes rooms that we have banned
#[arg(long)]
exclude_banned: bool,
#[arg(long)]
/// Whether to only output room IDs without supplementary room
/// information
no_details: bool,
2024-04-20 19:55:14 -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
}