From 4e68509faf9d52333fc783da71eca70dc7b0c767 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 10 Aug 2021 12:31:08 +0200 Subject: [PATCH] client-api: Work around another Element bug --- crates/ruma-client-api/CHANGELOG.md | 2 ++ crates/ruma-client-api/src/r0/contact/get_contacts.rs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index 84f57e09..99b995b9 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -9,6 +9,8 @@ Improvements: ``` * Add unstable support for room knocking * Add unstable support for reasons for leaving rooms +* Add a `feature = "compat"` workaround for Element failing on `GET /_matrix/client/r0/account/3pid` + response if the optional `threepids` field is missing # 0.11.0 diff --git a/crates/ruma-client-api/src/r0/contact/get_contacts.rs b/crates/ruma-client-api/src/r0/contact/get_contacts.rs index a9566835..33d5efb7 100644 --- a/crates/ruma-client-api/src/r0/contact/get_contacts.rs +++ b/crates/ruma-client-api/src/r0/contact/get_contacts.rs @@ -17,9 +17,9 @@ ruma_api! { request: {} response: { - /// A list of third party identifiers the homeserver has associated with the user's - /// account. - #[serde(default, skip_serializing_if = "Vec::is_empty")] + /// A list of third party identifiers the homeserver has associated with the user's account. + #[serde(default)] + #[cfg_attr(feature = "compat", serde(skip_serializing_if = "Vec::is_empty"))] pub threepids: Vec, }