mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
add admin command to delete individual media files
This commit is contained in:
parent
7672cc8473
commit
d7087c66bb
4 changed files with 78 additions and 3 deletions
|
|
@ -23,8 +23,8 @@ use ruma::{
|
|||
TimelineEventType,
|
||||
},
|
||||
signatures::verify_json,
|
||||
EventId, MilliSecondsSinceUnixEpoch, OwnedRoomId, RoomId, RoomVersionId,
|
||||
ServerName, UserId,
|
||||
EventId, MilliSecondsSinceUnixEpoch, OwnedMxcUri, OwnedRoomId, RoomId,
|
||||
RoomVersionId, ServerName, UserId,
|
||||
};
|
||||
use serde_json::value::to_raw_value;
|
||||
use tokio::sync::{mpsc, Mutex, RwLock};
|
||||
|
|
@ -179,6 +179,12 @@ enum AdminCommand {
|
|||
room_id: Box<RoomId>,
|
||||
},
|
||||
|
||||
/// Delete media and all associated thumbnails.
|
||||
DeleteMedia {
|
||||
/// mxc:// URI of the media to delete
|
||||
mxc: OwnedMxcUri,
|
||||
},
|
||||
|
||||
/// Verify json signatures
|
||||
/// [commandbody]()
|
||||
/// # ```
|
||||
|
|
@ -791,6 +797,12 @@ impl Service {
|
|||
services().rooms.metadata.disable_room(&room_id, false)?;
|
||||
RoomMessageEventContent::text_plain("Room enabled.")
|
||||
}
|
||||
AdminCommand::DeleteMedia {
|
||||
mxc,
|
||||
} => {
|
||||
services().media.delete(mxc).await?;
|
||||
RoomMessageEventContent::text_plain("Media deleted.")
|
||||
}
|
||||
AdminCommand::DeactivateUser {
|
||||
leave_rooms,
|
||||
user_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue