push: Add push rule to ignore room server ACLs
According to MSC3786
This commit is contained in:
parent
c63f03912b
commit
2f96fa5548
4 changed files with 23 additions and 0 deletions
|
@ -45,6 +45,7 @@ Improvements:
|
|||
* Add methods to sanitize messages according to the spec behind the `unstable-sanitize` feature
|
||||
* Can also remove rich reply fallbacks
|
||||
* Implement `From<Owned*Id>` for `identifiers::matrix_uri::MatrixId`
|
||||
* Add unstable default push rule to ignore room server ACLs events (MSC3786)
|
||||
|
||||
# 0.9.2
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ unstable-msc3551 = ["unstable-msc1767"]
|
|||
unstable-msc3552 = ["unstable-msc3551"]
|
||||
unstable-msc3553 = ["unstable-msc3552"]
|
||||
unstable-msc3554 = ["unstable-msc1767"]
|
||||
unstable-msc3786 = []
|
||||
|
||||
[dependencies]
|
||||
base64 = "0.13.0"
|
||||
|
|
|
@ -26,6 +26,8 @@ impl Ruleset {
|
|||
ConditionalPushRule::member_event(),
|
||||
ConditionalPushRule::contains_display_name(),
|
||||
ConditionalPushRule::tombstone(),
|
||||
#[cfg(feature = "unstable-msc3786")]
|
||||
ConditionalPushRule::server_acl(),
|
||||
ConditionalPushRule::roomnotif(),
|
||||
#[cfg(feature = "unstable-msc2677")]
|
||||
ConditionalPushRule::reaction(),
|
||||
|
@ -169,6 +171,23 @@ impl ConditionalPushRule {
|
|||
conditions: vec![EventMatch { key: "type".into(), pattern: "m.reaction".into() }],
|
||||
}
|
||||
}
|
||||
|
||||
/// Matches [room server ACLs].
|
||||
///
|
||||
/// [room server ACLs]: https://spec.matrix.org/v1.3/client-server-api/#server-access-control-lists-acls-for-rooms
|
||||
#[cfg(feature = "unstable-msc3786")]
|
||||
pub fn server_acl() -> Self {
|
||||
Self {
|
||||
actions: vec![],
|
||||
default: true,
|
||||
enabled: true,
|
||||
rule_id: ".org.matrix.msc3786.rule.room.server_acl".into(),
|
||||
conditions: vec![
|
||||
EventMatch { key: "type".into(), pattern: "m.room.server_acl".into() },
|
||||
EventMatch { key: "state_key".into(), pattern: "".into() },
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Default content push rules
|
||||
|
|
|
@ -152,6 +152,7 @@ unstable-msc3553 = ["ruma-common/unstable-msc3553"]
|
|||
unstable-msc3554 = ["ruma-common/unstable-msc3554"]
|
||||
unstable-msc3618 = ["ruma-federation-api?/unstable-msc3618"]
|
||||
unstable-msc3723 = ["ruma-federation-api?/unstable-msc3723"]
|
||||
unstable-msc3786 = ["ruma-common/unstable-msc3786"]
|
||||
|
||||
# Private feature, only used in test / benchmarking code
|
||||
__ci = [
|
||||
|
@ -177,6 +178,7 @@ __ci = [
|
|||
"unstable-msc3554",
|
||||
"unstable-msc3618",
|
||||
"unstable-msc3723",
|
||||
"unstable-msc3786",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
|
|
Loading…
Reference in a new issue