Upgrade ruma

… and refactor push rule code along the way.
This commit is contained in:
Jonas Platte 2021-04-05 21:25:10 +02:00
parent db7044a950
commit fe744c856f
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
13 changed files with 261 additions and 862 deletions

View file

@ -16,7 +16,7 @@ use rocket::futures::stream::{FuturesUnordered, StreamExt};
use ruma::{
api::{appservice, federation, OutgoingRequest},
events::{push_rules, EventType},
uint, ServerName, UInt, UserId,
push, uint, ServerName, UInt, UserId,
};
use sled::IVec;
use tokio::{select, sync::Semaphore};
@ -428,7 +428,7 @@ impl Sending {
.get::<push_rules::PushRulesEvent>(None, &userid, EventType::PushRules)
.map_err(|e| (OutgoingKind::Push(user.clone(), pushkey.clone()), e))?
.map(|ev| ev.content.global)
.unwrap_or_else(|| crate::push_rules::default_pushrules(&userid));
.unwrap_or_else(|| push::Ruleset::server_default(&userid));
let unread: UInt = if let Some(last_read) = db
.rooms