From 3869d75837b7aab60eef58fc834e498317d1e4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Dom=C3=ADnguez?= Date: Tue, 29 Sep 2020 16:42:11 +0200 Subject: [PATCH] Support synapse quirk for thirdparty module --- ruma-client-api/Cargo.toml | 2 +- ruma-common/Cargo.toml | 1 + ruma-common/src/thirdparty.rs | 8 ++++++++ ruma/Cargo.toml | 5 ++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ruma-client-api/Cargo.toml b/ruma-client-api/Cargo.toml index a8cbe461..d0381bb2 100644 --- a/ruma-client-api/Cargo.toml +++ b/ruma-client-api/Cargo.toml @@ -38,4 +38,4 @@ matches = "0.1.8" [features] unstable-exhaustive-types = [] unstable-pre-spec = [] -unstable-synapse-quirks = [] +unstable-synapse-quirks = ["ruma-common/unstable-synapse-quirks"] diff --git a/ruma-common/Cargo.toml b/ruma-common/Cargo.toml index 5f4ca3d7..7d96b40c 100644 --- a/ruma-common/Cargo.toml +++ b/ruma-common/Cargo.toml @@ -24,3 +24,4 @@ matches = "0.1.8" [features] unstable-exhaustive-types = [] +unstable-synapse-quirks = [] diff --git a/ruma-common/src/thirdparty.rs b/ruma-common/src/thirdparty.rs index 783a66e4..ab9e01ee 100644 --- a/ruma-common/src/thirdparty.rs +++ b/ruma-common/src/thirdparty.rs @@ -22,7 +22,11 @@ pub struct Protocol { 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, @@ -44,7 +48,11 @@ 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, diff --git a/ruma/Cargo.toml b/ruma/Cargo.toml index 211c7ab5..cb4fd15e 100644 --- a/ruma/Cargo.toml +++ b/ruma/Cargo.toml @@ -23,7 +23,10 @@ unstable-exhaustive-types = [ "ruma-common/unstable-exhaustive-types", ] unstable-pre-spec = ["ruma-client-api/unstable-pre-spec", "ruma-events/unstable-pre-spec"] -unstable-synapse-quirks = ["ruma-client-api/unstable-synapse-quirks"] +unstable-synapse-quirks = [ + "ruma-client-api/unstable-synapse-quirks", + "ruma-common/unstable-synapse-quirks", +] appservice-api = ["ruma-api", "ruma-appservice-api", "ruma-events"] client-api = ["ruma-api", "ruma-client-api", "ruma-events"]