remove box ids from admin room command arguments
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
83126cc667
commit
b3e5d2f683
20 changed files with 128 additions and 129 deletions
|
@ -3,19 +3,19 @@ use std::fmt::Write;
|
|||
use conduwuit::Result;
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
OwnedRoomId, RoomId, ServerName, UserId, events::room::message::RoomMessageEventContent,
|
||||
OwnedRoomId, OwnedServerName, OwnedUserId, events::room::message::RoomMessageEventContent,
|
||||
};
|
||||
|
||||
use crate::{admin_command, get_room_info};
|
||||
|
||||
#[admin_command]
|
||||
pub(super) async fn disable_room(&self, room_id: Box<RoomId>) -> Result<RoomMessageEventContent> {
|
||||
pub(super) async fn disable_room(&self, room_id: OwnedRoomId) -> Result<RoomMessageEventContent> {
|
||||
self.services.rooms.metadata.disable_room(&room_id, true);
|
||||
Ok(RoomMessageEventContent::text_plain("Room disabled."))
|
||||
}
|
||||
|
||||
#[admin_command]
|
||||
pub(super) async fn enable_room(&self, room_id: Box<RoomId>) -> Result<RoomMessageEventContent> {
|
||||
pub(super) async fn enable_room(&self, room_id: OwnedRoomId) -> Result<RoomMessageEventContent> {
|
||||
self.services.rooms.metadata.disable_room(&room_id, false);
|
||||
Ok(RoomMessageEventContent::text_plain("Room enabled."))
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ pub(super) async fn incoming_federation(&self) -> Result<RoomMessageEventContent
|
|||
#[admin_command]
|
||||
pub(super) async fn fetch_support_well_known(
|
||||
&self,
|
||||
server_name: Box<ServerName>,
|
||||
server_name: OwnedServerName,
|
||||
) -> Result<RoomMessageEventContent> {
|
||||
let response = self
|
||||
.services
|
||||
|
@ -90,7 +90,7 @@ pub(super) async fn fetch_support_well_known(
|
|||
#[admin_command]
|
||||
pub(super) async fn remote_user_in_rooms(
|
||||
&self,
|
||||
user_id: Box<UserId>,
|
||||
user_id: OwnedUserId,
|
||||
) -> Result<RoomMessageEventContent> {
|
||||
if user_id.server_name() == self.services.server.name {
|
||||
return Ok(RoomMessageEventContent::text_plain(
|
||||
|
|
|
@ -2,7 +2,7 @@ mod commands;
|
|||
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use ruma::{RoomId, ServerName, UserId};
|
||||
use ruma::{OwnedRoomId, OwnedServerName, OwnedUserId};
|
||||
|
||||
use crate::admin_command_dispatch;
|
||||
|
||||
|
@ -14,12 +14,12 @@ pub(super) enum FederationCommand {
|
|||
|
||||
/// - Disables incoming federation handling for a room.
|
||||
DisableRoom {
|
||||
room_id: Box<RoomId>,
|
||||
room_id: OwnedRoomId,
|
||||
},
|
||||
|
||||
/// - Enables incoming federation handling for a room again.
|
||||
EnableRoom {
|
||||
room_id: Box<RoomId>,
|
||||
room_id: OwnedRoomId,
|
||||
},
|
||||
|
||||
/// - Fetch `/.well-known/matrix/support` from the specified server
|
||||
|
@ -32,11 +32,11 @@ pub(super) enum FederationCommand {
|
|||
/// moderation, and security inquiries. This command provides a way to
|
||||
/// easily fetch that information.
|
||||
FetchSupportWellKnown {
|
||||
server_name: Box<ServerName>,
|
||||
server_name: OwnedServerName,
|
||||
},
|
||||
|
||||
/// - Lists all the rooms we share/track with the specified *remote* user
|
||||
RemoteUserInRooms {
|
||||
user_id: Box<UserId>,
|
||||
user_id: OwnedUserId,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue