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,