2024-06-16 22:26:52 +00:00
|
|
|
mod commands;
|
|
|
|
|
2024-04-21 19:37:52 -04:00
|
|
|
use clap::Subcommand;
|
2024-06-16 22:26:52 +00:00
|
|
|
use conduit::Result;
|
2024-04-21 19:37:52 -04:00
|
|
|
use ruma::events::room::message::RoomMessageEventContent;
|
|
|
|
|
2024-06-16 22:26:52 +00:00
|
|
|
use self::commands::*;
|
2024-04-21 19:37:52 -04:00
|
|
|
|
|
|
|
#[cfg_attr(test, derive(Debug))]
|
|
|
|
#[derive(Subcommand)]
|
2024-06-16 22:26:52 +00:00
|
|
|
pub(super) enum FsckCommand {
|
2024-04-21 19:37:52 -04:00
|
|
|
CheckAllUsers,
|
|
|
|
}
|
|
|
|
|
2024-06-16 22:26:52 +00:00
|
|
|
pub(super) async fn process(command: FsckCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
|
2024-04-21 19:37:52 -04:00
|
|
|
Ok(match command {
|
|
|
|
FsckCommand::CheckAllUsers => check_all_users(body).await?,
|
|
|
|
})
|
|
|
|
}
|