add command to set the allow registration status #902
1 changed files with 10 additions and 0 deletions
|
@ -153,6 +153,10 @@ enum AdminCommand {
|
|||
password: Option<String>,
|
||||
},
|
||||
|
||||
/// Set true to allow new users to register.
|
||||
/// This setting does not persist restarts, for that use the config
|
||||
AllowRegistration(bool),
|
||||
|
||||
/// Disables incoming federation handling for a room.
|
||||
DisableRoom { room_id: Box<RoomId> },
|
||||
/// Enables incoming federation handling for a room again.
|
||||
|
@ -644,6 +648,12 @@ impl Service {
|
|||
"Created user with user_id: {user_id} and password: {password}"
|
||||
))
|
||||
}
|
||||
AdminCommand::AllowRegistration(status) => {
|
||||
services().globals.config.allow_registration = status;
|
||||
RoomMessageEventContent::text_plain(format!(
|
||||
"Updated allow registration status: {status}"
|
||||
))
|
||||
}
|
||||
AdminCommand::DisableRoom { room_id } => {
|
||||
services().rooms.metadata.disable_room(&room_id, true)?;
|
||||
RoomMessageEventContent::text_plain("Room disabled.")
|
||||
|
|
Loading…
Reference in a new issue