reorg PduEvent strip tools and callsites

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-03-30 21:19:47 +00:00
parent dc6e9e74d9
commit bee4c6255a
13 changed files with 152 additions and 71 deletions

View file

@ -461,7 +461,7 @@ async fn handle_left_room(
events: Vec::new(),
},
state: RoomState {
events: vec![event.to_sync_state_event()],
events: vec![event.into_sync_state_event()],
},
}));
}
@ -546,7 +546,7 @@ async fn handle_left_room(
continue;
}
left_state_events.push(pdu.to_sync_state_event());
left_state_events.push(pdu.into_sync_state_event());
}
}
@ -865,8 +865,8 @@ async fn load_joined_room(
},
state: RoomState {
events: state_events
.iter()
.map(PduEvent::to_sync_state_event)
.into_iter()
.map(PduEvent::into_sync_state_event)
.collect(),
},
ephemeral: Ephemeral { events: edus },

View file

@ -6,7 +6,7 @@ use std::{
use axum::extract::State;
use conduwuit::{
Error, PduCount, Result, debug, error, extract_variant,
Error, PduCount, PduEvent, Result, debug, error, extract_variant,
utils::{
BoolExt, IterStream, ReadyExt, TryFutureExtExt,
math::{ruma_from_usize, usize_from_ruma, usize_from_u64_truncated},
@ -634,7 +634,7 @@ pub(crate) async fn sync_events_v4_route(
.state_accessor
.room_state_get(room_id, &state.0, &state.1)
.await
.map(|s| s.to_sync_state_event())
.map(PduEvent::into_sync_state_event)
.ok()
})
.collect()

View file

@ -6,7 +6,7 @@ use std::{
use axum::extract::State;
use conduwuit::{
Error, Result, TypeStateKey, debug, error, extract_variant, trace,
Error, PduEvent, Result, TypeStateKey, debug, error, extract_variant, trace,
utils::{
BoolExt, IterStream, ReadyExt, TryFutureExtExt,
math::{ruma_from_usize, usize_from_ruma},
@ -507,7 +507,7 @@ async fn process_rooms(
.state_accessor
.room_state_get(room_id, &state.0, &state.1)
.await
.map(|s| s.to_sync_state_event())
.map(PduEvent::into_sync_state_event)
.ok()
})
.collect()