Rebase with key backups and cross signing

Moved back to a fork of ruma with timo's key-backup and cross-signing
branch. Ephemeral events in sync responses are EphemeralRoomEventStub
(they also have no room_id like all of sync responses events)
This commit is contained in:
Devin R 2020-06-26 18:34:11 -04:00
parent 84dcb885a7
commit 63e23154f3
6 changed files with 2149 additions and 25 deletions

View file

@ -1,7 +1,10 @@
use js_int::uint;
use ruma::{
events::push_rules::{ConditionalPushRule, PatternedPushRule, PushCondition, Ruleset},
identifiers::UserId,
push::{Action, Tweak},
push::{
Action, ConditionalPushRule, PatternedPushRule, PushCondition, RoomMemberCountIs, Ruleset,
Tweak,
},
};
pub fn default_pushrules(user_id: &UserId) -> Ruleset {
@ -174,7 +177,9 @@ pub fn encrypted_room_one_to_one_rule() -> ConditionalPushRule {
enabled: true,
rule_id: ".m.rule.encrypted_room_one_to_one".to_owned(),
conditions: vec![
PushCondition::RoomMemberCount { is: "2".to_owned() },
PushCondition::RoomMemberCount {
is: RoomMemberCountIs::from(uint!(2)..),
},
PushCondition::EventMatch {
key: "type".to_owned(),
pattern: "m.room.encrypted".to_owned(),
@ -194,7 +199,9 @@ pub fn room_one_to_one_rule() -> ConditionalPushRule {
enabled: true,
rule_id: ".m.rule.room_one_to_one".to_owned(),
conditions: vec![
PushCondition::RoomMemberCount { is: "2".to_owned() },
PushCondition::RoomMemberCount {
is: RoomMemberCountIs::from(uint!(2)..),
},
PushCondition::EventMatch {
key: "type".to_owned(),
pattern: "m.room.message".to_owned(),