Check PDU formats

This commit is contained in:
dasha_uwu
2025-12-18 01:34:02 +05:00
committed by Jason Volk
parent c5508bba58
commit 7b2079f714
8 changed files with 35 additions and 19 deletions

View File

@@ -68,6 +68,8 @@ pub(super) async fn handle_outlier_pdu(
let room_rules = room_version::rules(room_version)?;
state_res::check_pdu_format(&pdu_json, &room_rules.event_format)?;
// Now that we have checked the signature and hashes we can make mutations and
// convert to our PduEvent type.
let event = from_incoming_federation(room_id, event_id, &mut pdu_json, &room_rules)?;

View File

@@ -52,6 +52,8 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu(
let timer = Instant::now();
let room_rules = room_version::rules(room_version)?;
state_res::check_pdu_format(&val, &room_rules.event_format)?;
// 10. Fetch missing state and auth chain events by calling /state_ids at
// backwards extremities doing all the checks in this list starting at 1.
// These are not timeline events.