From 7493353c5a880ed91b3c6b6b6360c9fb987bcd1a Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 22 Apr 2019 22:11:18 +0200 Subject: [PATCH 1/4] Add missing request body to create_media_conent --- src/r0/media/create_content.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/r0/media/create_content.rs b/src/r0/media/create_content.rs index d0bfa4aa..0ee953de 100644 --- a/src/r0/media/create_content.rs +++ b/src/r0/media/create_content.rs @@ -17,6 +17,9 @@ ruma_api! { /// The content type of the file being uploaded. #[ruma_api(header = "CONTENT_TYPE")] pub content_type: String, + /// The file contents to upload. + #[ruma_api(body)] + pub file: Vec, } response { From 4c3e5d3324bae0416e359db5d14d2f7f60f64378 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 22 Apr 2019 22:12:43 +0200 Subject: [PATCH 2/4] Update create_media_content to r0.4.0 --- src/r0/media/create_content.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/r0/media/create_content.rs b/src/r0/media/create_content.rs index 0ee953de..c6ccc779 100644 --- a/src/r0/media/create_content.rs +++ b/src/r0/media/create_content.rs @@ -1,4 +1,4 @@ -//! [POST /_matrix/media/r0/upload](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-media-r0-upload) +//! [POST /_matrix/media/r0/upload](https://matrix.org/docs/spec/client_server/r0.4.0.html#post-matrix-media-r0-upload) use ruma_api_macros::ruma_api; use serde::{Deserialize, Serialize}; @@ -9,11 +9,15 @@ ruma_api! { method: POST, name: "create_media_content", path: "/_matrix/media/r0/upload", - rate_limited: false, - requires_authentication: false, + rate_limited: true, + requires_authentication: true, } request { + /// The name of the file being uploaded. + #[serde(skip_serializing_if = "Option::is_none")] + #[ruma_api(query)] + pub filename: Option, /// The content type of the file being uploaded. #[ruma_api(header = "CONTENT_TYPE")] pub content_type: String, From 85236be89c65510b2c67b4d1755e897f83644a27 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 22 Apr 2019 22:27:38 +0200 Subject: [PATCH 3/4] Update get_filter endpoint to r0.4.0 --- src/r0/filter/get_filter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r0/filter/get_filter.rs b/src/r0/filter/get_filter.rs index 23688b06..0f8bea5a 100644 --- a/src/r0/filter/get_filter.rs +++ b/src/r0/filter/get_filter.rs @@ -1,4 +1,4 @@ -//! [GET /_matrix/client/r0/user/{userId}/filter/{filterId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-user-userid-filter-filterid) +//! [GET /_matrix/client/r0/user/{userId}/filter/{filterId}](https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-user-userid-filter-filterid) use ruma_api_macros::ruma_api; use ruma_identifiers::UserId; @@ -13,7 +13,7 @@ ruma_api! { name: "get_filter", path: "/_matrix/client/r0/user/:user_id/filter/:filter_id", rate_limited: false, - requires_authentication: false, + requires_authentication: true, } request { From af8fe4225973d68826cc40a1e6fe630d2d38ab1c Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 22 Apr 2019 22:33:37 +0200 Subject: [PATCH 4/4] Update link in get_member_events doc comment no code changes were necessary even though the spec was updated: we already specified requires_authentication: true when the spec was missing that information. --- src/r0/sync/get_member_events.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r0/sync/get_member_events.rs b/src/r0/sync/get_member_events.rs index 89c9bbae..c4e0d20a 100644 --- a/src/r0/sync/get_member_events.rs +++ b/src/r0/sync/get_member_events.rs @@ -1,4 +1,4 @@ -//! [GET /_matrix/client/r0/rooms/{roomId}/members](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-members) +//! [GET /_matrix/client/r0/rooms/{roomId}/members](https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-rooms-roomid-members) use ruma_api_macros::ruma_api; use ruma_events::room::member::MemberEvent;