From f2c2f2df2f4d7959d7dcf3719fd7ead4b9f0e2fa Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 23 Nov 2020 19:12:19 +0100 Subject: [PATCH] common: Don't change fields in thirdparty::Protocol with `unstable-synapse-quirks` --- ruma-common/src/thirdparty.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ruma-common/src/thirdparty.rs b/ruma-common/src/thirdparty.rs index 21eabcf1..258d242b 100644 --- a/ruma-common/src/thirdparty.rs +++ b/ruma-common/src/thirdparty.rs @@ -23,13 +23,12 @@ pub struct Protocol { pub location_fields: Vec, /// A content URI representing an icon for the third party protocol. - #[cfg(not(feature = "unstable-synapse-quirks"))] + /// + /// If you activate the `unstable-synapse-quirks` feature, this field being absent in JSON will + /// give you an empty string here. + #[cfg_attr(feature = "unstable-synapse-quirks", serde(default))] pub icon: String, - /// A content URI representing an icon for the third party protocol. - #[cfg(feature = "unstable-synapse-quirks")] - pub icon: Option, - /// The type definitions for the fields defined in `user_fields` and `location_fields`. pub field_types: BTreeMap, @@ -50,13 +49,8 @@ pub struct ProtocolInit { pub location_fields: Vec, /// A content URI representing an icon for the third party protocol. - #[cfg(not(feature = "unstable-synapse-quirks"))] pub icon: String, - /// A content URI representing an icon for the third party protocol. - #[cfg(feature = "unstable-synapse-quirks")] - pub icon: Option, - /// The type definitions for the fields defined in `user_fields` and `location_fields`. pub field_types: BTreeMap,