common: Don't change fields in thirdparty::Protocol with unstable-synapse-quirks

This commit is contained in:
Jonas Platte 2020-11-23 19:12:19 +01:00
parent ee4280cea2
commit f2c2f2df2f
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -23,13 +23,12 @@ pub struct Protocol {
pub location_fields: Vec<String>, pub location_fields: Vec<String>,
/// A content URI representing an icon for the third party protocol. /// 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, pub icon: String,
/// A content URI representing an icon for the third party protocol.
#[cfg(feature = "unstable-synapse-quirks")]
pub icon: Option<String>,
/// The type definitions for the fields defined in `user_fields` and `location_fields`. /// The type definitions for the fields defined in `user_fields` and `location_fields`.
pub field_types: BTreeMap<String, FieldType>, pub field_types: BTreeMap<String, FieldType>,
@ -50,13 +49,8 @@ pub struct ProtocolInit {
pub location_fields: Vec<String>, pub location_fields: Vec<String>,
/// A content URI representing an icon for the third party protocol. /// A content URI representing an icon for the third party protocol.
#[cfg(not(feature = "unstable-synapse-quirks"))]
pub icon: String, pub icon: String,
/// A content URI representing an icon for the third party protocol.
#[cfg(feature = "unstable-synapse-quirks")]
pub icon: Option<String>,
/// The type definitions for the fields defined in `user_fields` and `location_fields`. /// The type definitions for the fields defined in `user_fields` and `location_fields`.
pub field_types: BTreeMap<String, FieldType>, pub field_types: BTreeMap<String, FieldType>,