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

@ -6,7 +6,7 @@ use std::{fmt::Write, sync::Arc};
use async_trait::async_trait;
use conduwuit::{
Err, Error, Result, implement,
Err, Error, PduEvent, Result, implement,
utils::{
IterStream,
future::BoolExt,
@ -267,11 +267,12 @@ fn get_stripped_space_child_events<'a>(
}
if RoomId::parse(&state_key).is_ok() {
return Some(pdu.to_stripped_spacechild_state_event());
return Some(pdu);
}
None
})
.map(PduEvent::into_stripped_spacechild_state_event)
}
/// Gets the summary of a space using either local or remote (federation)

View file

@ -341,7 +341,7 @@ impl Service {
.await
.into_iter()
.filter_map(Result::ok)
.map(|e| e.to_stripped_state_event())
.map(PduEvent::into_stripped_state_event)
.chain(once(event.to_stripped_state_event()))
.collect()
}

View file

@ -697,7 +697,7 @@ impl Service {
match event {
| SendingEvent::Pdu(pdu_id) => {
if let Ok(pdu) = self.services.timeline.get_pdu_from_id(pdu_id).await {
pdu_jsons.push(pdu.to_room_event());
pdu_jsons.push(pdu.into_room_event());
}
},
| SendingEvent::Edu(edu) =>