Toward abstracting Pdu into trait Event.

Co-authored-by: Jade Ellis <jade@ellis.link>
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-26 08:24:47 +00:00 committed by Jade Ellis
commit 116f85360f
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
41 changed files with 842 additions and 886 deletions

View file

@ -375,8 +375,6 @@ impl Service {
.await
.unwrap_or_default();
let sync_pdu = pdu.to_sync_room_event();
let mut push_target: HashSet<_> = self
.services
.state_cache
@ -401,6 +399,7 @@ impl Service {
}
}
let serialized = pdu.to_format();
for user in &push_target {
let rules_for_user = self
.services
@ -418,7 +417,7 @@ impl Service {
for action in self
.services
.pusher
.get_actions(user, &rules_for_user, &power_levels, &sync_pdu, &pdu.room_id)
.get_actions(user, &rules_for_user, &power_levels, &serialized, &pdu.room_id)
.await
{
match action {
@ -768,7 +767,7 @@ impl Service {
let auth_fetch = |k: &StateEventType, s: &str| {
let key = (k.clone(), s.into());
ready(auth_events.get(&key))
ready(auth_events.get(&key).map(ToOwned::to_owned))
};
let auth_check = state_res::auth_check(