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

feat(media): save user id of uploader

This commit is contained in:
Matthias Ahouansou 2025-03-29 13:20:55 +00:00
parent 19d0ea408c
commit 3171b779c6
No known key found for this signature in database
5 changed files with 36 additions and 4 deletions

View file

@ -5,7 +5,7 @@ pub use data::Data;
use ruma::{
api::client::{error::ErrorKind, media::is_safe_inline_content_type},
http_headers::{ContentDisposition, ContentDispositionType},
ServerName,
ServerName, UserId,
};
use sha2::{digest::Output, Digest, Sha256};
@ -43,6 +43,7 @@ impl Service {
filename: Option<&str>,
content_type: Option<&str>,
file: &[u8],
user_id: Option<&UserId>,
) -> Result<()> {
let (sha256_digest, sha256_hex) = generate_digests(file);
@ -53,6 +54,7 @@ impl Service {
media_id,
filename,
content_type,
user_id,
)?;
create_file(&sha256_hex, file).await