chain_width to 50

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-04-22 04:42:26 +00:00
parent 9b658d86b2
commit 76509830e6
190 changed files with 3469 additions and 930 deletions

View File

@@ -25,8 +25,12 @@ pub async fn acl_check(&self, server_name: &ServerName, room_id: &RoomId) -> Res
return Ok(());
}
if acl_event_content.deny.contains(&String::from("*"))
&& acl_event_content.allow.contains(&String::from("*"))
if acl_event_content
.deny
.contains(&String::from("*"))
&& acl_event_content
.allow
.contains(&String::from("*"))
{
warn!(%room_id, "Ignoring broken ACL event (allow key and deny key both contain wildcard \"*\"");
return Ok(());

View File

@@ -66,7 +66,11 @@ pub async fn handle_incoming_pdu<'a>(
let meta_exists = self.services.metadata.exists(room_id).map(Ok);
// 1.2 Check if the room is disabled
let is_disabled = self.services.metadata.is_disabled(room_id).map(Ok);
let is_disabled = self
.services
.metadata
.is_disabled(room_id)
.map(Ok);
// 1.3.1 Check room ACL on origin field/server
let origin_acl_check = self.acl_check(origin, room_id);

View File

@@ -100,7 +100,11 @@ impl Service {
}
async fn event_fetch(&self, event_id: OwnedEventId) -> Option<PduEvent> {
self.services.timeline.get_pdu(&event_id).await.ok()
self.services
.timeline
.get_pdu(&event_id)
.await
.ok()
}
}

View File

@@ -92,7 +92,11 @@ pub async fn resolve_state(
let new_room_state: CompressedState = self
.services
.state_compressor
.compress_state_events(state_events.iter().map(|(ssk, eid)| (ssk, (*eid).borrow())))
.compress_state_events(
state_events
.iter()
.map(|(ssk, eid)| (ssk, (*eid).borrow())),
)
.collect()
.await;

View File

@@ -54,7 +54,8 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu(
debug!("Resolving state at event");
let mut state_at_incoming_event = if incoming_pdu.prev_events.len() == 1 {
self.state_at_incoming_degree_one(&incoming_pdu).await?
self.state_at_incoming_degree_one(&incoming_pdu)
.await?
} else {
self.state_at_incoming_resolved(&incoming_pdu, room_id, &room_version_id)
.await?
@@ -74,10 +75,19 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu(
// 11. Check the auth of the event passes based on the state of the event
let state_fetch_state = &state_at_incoming_event;
let state_fetch = |k: StateEventType, s: StateKey| async move {
let shortstatekey = self.services.short.get_shortstatekey(&k, &s).await.ok()?;
let shortstatekey = self
.services
.short
.get_shortstatekey(&k, &s)
.await
.ok()?;
let event_id = state_fetch_state.get(&shortstatekey)?;
self.services.timeline.get_pdu(event_id).await.ok()
self.services
.timeline
.get_pdu(event_id)
.await
.ok()
};
let auth_check = state_res::event_auth::auth_check(