Abstract Pdu filter matching into trait Event.

Abstract Pdu unsigned accessors into trait Event.

Abstract Pdu relation related into trait Event.

Abstract PDU content into trait Event.

Move event_id utils from pdu to event.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-04-27 09:34:07 +00:00
parent 222e89f6fe
commit af7dfb31bc
56 changed files with 666 additions and 492 deletions

View File

@@ -53,7 +53,9 @@ pub(crate) async fn room_initial_sync_route(
.try_collect::<Vec<_>>();
let (membership, visibility, state, events) =
try_join4(membership, visibility, state, events).await?;
try_join4(membership, visibility, state, events)
.boxed()
.await?;
let messages = PaginationChunk {
start: events

View File

@@ -18,7 +18,7 @@ use ruma::{
use serde_json::{json, value::to_raw_value};
use tuwunel_core::{
Error, Result, err, info,
matrix::{StateKey, pdu::PduBuilder},
matrix::{Event, StateKey, pdu::PduBuilder},
};
use crate::Ruma;
@@ -226,7 +226,7 @@ pub(crate) async fn upgrade_room_route(
.room_state_get(&body.room_id, event_type, "")
.await
{
| Ok(v) => v.content.clone(),
| Ok(v) => v.content().to_owned(),
| Err(_) => continue, // Skipping missing events.
};