Support synapse quirk for thirdparty module

This commit is contained in:
Alejandro Domínguez 2020-09-29 16:42:11 +02:00 committed by GitHub
parent d1f8a7404c
commit 3869d75837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -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"]

View File

@ -24,3 +24,4 @@ matches = "0.1.8"
[features]
unstable-exhaustive-types = []
unstable-synapse-quirks = []

View File

@ -22,7 +22,11 @@ pub struct Protocol {
pub location_fields: Vec<String>,
/// 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<String>,
/// The type definitions for the fields defined in `user_fields` and `location_fields`.
pub field_types: BTreeMap<String, FieldType>,
@ -44,7 +48,11 @@ pub struct ProtocolInit {
pub location_fields: Vec<String>,
/// 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<String>,
/// The type definitions for the fields defined in `user_fields` and `location_fields`.
pub field_types: BTreeMap<String, FieldType>,

View File

@ -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"]