From b3f7d0ed526a9feec75c0a98f36332ccb3e4a5f1 Mon Sep 17 00:00:00 2001 From: plustik <70038054+plustik@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:28:11 +0100 Subject: [PATCH] client-api: Update get_message_events for v1.1 * Remove serde(skip_serializing_if = ...) attribute from chunk response field * Make the start response field required by changing its type from Option to String --- crates/ruma-client-api/CHANGELOG.md | 2 ++ .../ruma-client-api/src/r0/message/get_message_events.rs | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index a430aa67..95361cf3 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -18,6 +18,8 @@ Breaking changes: `r0::account::request_3pid_management_token_via_email` * `get_contacts` has been can now be found at `r0::account::get_3pids` * Move `r0::uiaa::authorize_fallback` to `r0::uiaa::get_uiaa_fallback_page` +* Change type of field `start` of `r0::message::get_message_events::Response` to + `String` in accordance with the updated specification. Improvements: diff --git a/crates/ruma-client-api/src/r0/message/get_message_events.rs b/crates/ruma-client-api/src/r0/message/get_message_events.rs index 3fe7f891..1e7b4bfb 100644 --- a/crates/ruma-client-api/src/r0/message/get_message_events.rs +++ b/crates/ruma-client-api/src/r0/message/get_message_events.rs @@ -1,4 +1,4 @@ -//! [GET /_matrix/client/r0/rooms/{roomId}/messages](https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-messages) +//! [GET /_matrix/client/r0/rooms/{roomId}/messages](https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3roomsroomidmessages) use js_int::{uint, UInt}; use ruma_api::ruma_api; @@ -65,15 +65,14 @@ ruma_api! { #[derive(Default)] response: { /// The token the pagination starts from. - #[serde(skip_serializing_if = "Option::is_none")] - pub start: Option, + pub start: String, /// The token the pagination ends at. #[serde(skip_serializing_if = "Option::is_none")] pub end: Option, /// A list of room events. - #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub chunk: Vec>, /// A list of state events relevant to showing the `chunk`.