refactor admin command visibilities and use statements

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-16 22:26:52 +00:00
parent c6f4b20e17
commit 50ce87161b
30 changed files with 145 additions and 152 deletions

View file

@ -1,15 +1,14 @@
pub(crate) mod user_commands;
mod commands;
use clap::Subcommand;
use conduit::Result;
use ruma::{events::room::message::RoomMessageEventContent, RoomId};
use user_commands::{delete_room_tag, get_room_tags, put_room_tag};
use self::user_commands::{create, deactivate, deactivate_all, list, list_joined_rooms, reset_password};
use crate::Result;
use self::commands::*;
#[cfg_attr(test, derive(Debug))]
#[derive(Subcommand)]
pub(crate) enum UserCommand {
pub(super) enum UserCommand {
/// - Create a new user
Create {
/// Username of the new user
@ -93,7 +92,7 @@ pub(crate) enum UserCommand {
},
}
pub(crate) async fn process(command: UserCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
pub(super) async fn process(command: UserCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
Ok(match command {
UserCommand::List => list(body).await?,
UserCommand::Create {