remove box ids from admin room command arguments
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -5,7 +5,7 @@ use conduwuit::{
|
||||
};
|
||||
use conduwuit_service::media::Dim;
|
||||
use ruma::{
|
||||
EventId, Mxc, MxcUri, OwnedMxcUri, OwnedServerName, ServerName,
|
||||
Mxc, OwnedEventId, OwnedMxcUri, OwnedServerName,
|
||||
events::room::message::RoomMessageEventContent,
|
||||
};
|
||||
|
||||
@@ -14,8 +14,8 @@ use crate::{admin_command, utils::parse_local_user_id};
|
||||
#[admin_command]
|
||||
pub(super) async fn delete(
|
||||
&self,
|
||||
mxc: Option<Box<MxcUri>>,
|
||||
event_id: Option<Box<EventId>>,
|
||||
mxc: Option<OwnedMxcUri>,
|
||||
event_id: Option<OwnedEventId>,
|
||||
) -> Result<RoomMessageEventContent> {
|
||||
if event_id.is_some() && mxc.is_some() {
|
||||
return Ok(RoomMessageEventContent::text_plain(
|
||||
@@ -282,7 +282,7 @@ pub(super) async fn delete_all_from_user(
|
||||
#[admin_command]
|
||||
pub(super) async fn delete_all_from_server(
|
||||
&self,
|
||||
server_name: Box<ServerName>,
|
||||
server_name: OwnedServerName,
|
||||
yes_i_want_to_delete_local_media: bool,
|
||||
) -> Result<RoomMessageEventContent> {
|
||||
if server_name == self.services.globals.server_name() && !yes_i_want_to_delete_local_media {
|
||||
|
||||
@@ -3,7 +3,7 @@ mod commands;
|
||||
|
||||
use clap::Subcommand;
|
||||
use conduwuit::Result;
|
||||
use ruma::{EventId, MxcUri, OwnedMxcUri, OwnedServerName, ServerName};
|
||||
use ruma::{OwnedEventId, OwnedMxcUri, OwnedServerName};
|
||||
|
||||
use crate::admin_command_dispatch;
|
||||
|
||||
@@ -15,12 +15,12 @@ pub(super) enum MediaCommand {
|
||||
Delete {
|
||||
/// The MXC URL to delete
|
||||
#[arg(long)]
|
||||
mxc: Option<Box<MxcUri>>,
|
||||
mxc: Option<OwnedMxcUri>,
|
||||
|
||||
/// - The message event ID which contains the media and thumbnail MXC
|
||||
/// URLs
|
||||
#[arg(long)]
|
||||
event_id: Option<Box<EventId>>,
|
||||
event_id: Option<OwnedEventId>,
|
||||
},
|
||||
|
||||
/// - Deletes a codeblock list of MXC URLs from our database and on the
|
||||
@@ -57,7 +57,7 @@ pub(super) enum MediaCommand {
|
||||
/// - Deletes all remote media from the specified remote server. This will
|
||||
/// always ignore errors by default.
|
||||
DeleteAllFromServer {
|
||||
server_name: Box<ServerName>,
|
||||
server_name: OwnedServerName,
|
||||
|
||||
/// Long argument to delete local media
|
||||
#[arg(long)]
|
||||
|
||||
Reference in New Issue
Block a user