1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-09-15 18:57:03 +00:00

feat(admin): commands for purging media

This commit is contained in:
Matthias Ahouansou 2025-03-30 00:54:09 +00:00
parent 33b02c868d
commit d76637048a
No known key found for this signature in database
6 changed files with 937 additions and 82 deletions

View file

@ -1,4 +1,4 @@
use ruma::{ServerName, UserId};
use ruma::{OwnedServerName, ServerName, UserId};
use sha2::{digest::Output, Sha256};
use crate::Result;
@ -42,4 +42,24 @@ pub trait Data: Send + Sync {
width: u32,
height: u32,
) -> Result<DbFileMeta>;
fn purge_and_get_hashes(
&self,
media: &[(OwnedServerName, String)],
force_filehash: bool,
) -> Vec<Result<String>>;
fn purge_and_get_hashes_from_user(
&self,
user_id: &UserId,
force_filehash: bool,
after: Option<u64>,
) -> Vec<Result<String>>;
fn purge_and_get_hashes_from_server(
&self,
server_name: &ServerName,
force_filehash: bool,
after: Option<u64>,
) -> Vec<Result<String>>;
}