From 0e5503ed8865bf5502fc6ba7051b953d985e3368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 4 May 2023 11:23:31 +0200 Subject: [PATCH] client-api: Add filename field for create_content_async --- crates/ruma-client-api/src/media/create_content_async.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ruma-client-api/src/media/create_content_async.rs b/crates/ruma-client-api/src/media/create_content_async.rs index f4f1fa5f..edae250b 100644 --- a/crates/ruma-client-api/src/media/create_content_async.rs +++ b/crates/ruma-client-api/src/media/create_content_async.rs @@ -40,6 +40,11 @@ pub mod unstable { /// The content type of the file being uploaded. #[ruma_api(header = CONTENT_TYPE)] pub content_type: Option, + + /// The name of the file being uploaded. + #[ruma_api(query)] + #[serde(skip_serializing_if = "Option::is_none")] + pub filename: Option, // TODO: How does this and msc2448 (blurhash) interact? } @@ -50,7 +55,7 @@ pub mod unstable { impl Request { /// Creates a new `Request` with the given file contents. pub fn new(media_id: String, server_name: OwnedServerName, file: Vec) -> Self { - Self { media_id, server_name, file, content_type: None } + Self { media_id, server_name, file, content_type: None, filename: None } } /// Creates a new `Request` with the given url and file contents.