Add push rule for .m.rule.reaction
This commit is contained in:
parent
8c109d3c0a
commit
adeb545062
@ -35,7 +35,7 @@ matches = "0.1.8"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-pre-spec = []
|
unstable-pre-spec = ["ruma-common/unstable-pre-spec"]
|
||||||
unstable-synapse-quirks = [
|
unstable-synapse-quirks = [
|
||||||
"ruma-common/unstable-synapse-quirks",
|
"ruma-common/unstable-synapse-quirks",
|
||||||
"ruma-events/unstable-synapse-quirks",
|
"ruma-events/unstable-synapse-quirks",
|
||||||
|
@ -24,3 +24,4 @@ matches = "0.1.8"
|
|||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-synapse-quirks = []
|
unstable-synapse-quirks = []
|
||||||
|
unstable-pre-spec = []
|
||||||
|
@ -21,6 +21,18 @@ impl Ruleset {
|
|||||||
pub fn server_default(user_id: &UserId) -> Self {
|
pub fn server_default(user_id: &UserId) -> Self {
|
||||||
Self {
|
Self {
|
||||||
content: btreeset![ContentPushRule::contains_user_name(user_id)],
|
content: btreeset![ContentPushRule::contains_user_name(user_id)],
|
||||||
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
|
override_: btreeset![
|
||||||
|
OverridePushRule::master(),
|
||||||
|
OverridePushRule::suppress_notices(),
|
||||||
|
OverridePushRule::invite_for_me(user_id),
|
||||||
|
OverridePushRule::member_event(),
|
||||||
|
OverridePushRule::contains_display_name(),
|
||||||
|
OverridePushRule::tombstone(),
|
||||||
|
OverridePushRule::roomnotif(),
|
||||||
|
OverridePushRule::reaction(),
|
||||||
|
],
|
||||||
|
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||||
override_: btreeset![
|
override_: btreeset![
|
||||||
OverridePushRule::master(),
|
OverridePushRule::master(),
|
||||||
OverridePushRule::suppress_notices(),
|
OverridePushRule::suppress_notices(),
|
||||||
@ -146,6 +158,19 @@ impl OverridePushRule {
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Matches emoji reactions to a message
|
||||||
|
/// MSC2677: Annotations and Reactions
|
||||||
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
|
pub fn reaction() -> Self {
|
||||||
|
Self(ConditionalPushRule {
|
||||||
|
actions: vec![DontNotify],
|
||||||
|
default: true,
|
||||||
|
enabled: true,
|
||||||
|
rule_id: ".m.rule.reaction".into(),
|
||||||
|
conditions: vec![EventMatch { key: "type".into(), pattern: "m.reaction".into() }],
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Default content push rules
|
/// Default content push rules
|
||||||
|
@ -30,7 +30,7 @@ trybuild = "1.0.38"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-pre-spec = []
|
unstable-pre-spec = ["ruma-common/unstable-pre-spec"]
|
||||||
unstable-synapse-quirks = []
|
unstable-synapse-quirks = []
|
||||||
markdown = ["pulldown-cmark"]
|
markdown = ["pulldown-cmark"]
|
||||||
|
|
||||||
|
@ -29,5 +29,5 @@ matches = "0.1.8"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
unstable-pre-spec = []
|
unstable-pre-spec = ["ruma-common/unstable-pre-spec"]
|
||||||
unstable-synapse-quirks = ["ruma-events/unstable-synapse-quirks"]
|
unstable-synapse-quirks = ["ruma-events/unstable-synapse-quirks"]
|
||||||
|
@ -57,6 +57,7 @@ unstable-pre-spec = [
|
|||||||
"ruma-client-api/unstable-pre-spec",
|
"ruma-client-api/unstable-pre-spec",
|
||||||
"ruma-events/unstable-pre-spec",
|
"ruma-events/unstable-pre-spec",
|
||||||
"ruma-federation-api/unstable-pre-spec",
|
"ruma-federation-api/unstable-pre-spec",
|
||||||
|
"ruma-common/unstable-pre-spec",
|
||||||
]
|
]
|
||||||
unstable-synapse-quirks = [
|
unstable-synapse-quirks = [
|
||||||
"ruma-client-api/unstable-synapse-quirks",
|
"ruma-client-api/unstable-synapse-quirks",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user