move PduEvent from services to core

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-03 21:05:24 +00:00
parent 229f2fde7a
commit 0cea64309a
15 changed files with 118 additions and 100 deletions

View file

@ -1,8 +1,10 @@
use std::sync::Arc;
use conduit::{Error, Result};
use ruma::api::{client::error::ErrorKind, federation::event::get_room_state};
use service::{sending::convert_to_outgoing_federation_event, services};
use crate::{services, Error, PduEvent, Result, Ruma};
use crate::Ruma;
/// # `GET /_matrix/federation/v1/state/{roomId}`
///
@ -42,7 +44,7 @@ pub(crate) async fn get_room_state_route(
.await?
.into_values()
.map(|id| {
PduEvent::convert_to_outgoing_federation_event(
convert_to_outgoing_federation_event(
services()
.rooms
.timeline
@ -67,7 +69,7 @@ pub(crate) async fn get_room_state_route(
.timeline
.get_pdu_json(&id)
.ok()?
.map(PduEvent::convert_to_outgoing_federation_event)
.map(convert_to_outgoing_federation_event)
})
.collect(),
pdus,