mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 21:26:50 +00:00
Services refactor
Replace structs of Dep<Service> with OnceServices, so each service has a Services reference Remove service name => Service map Flatten Services.rooms Make reqwest Clients lazy initialized (client service)
This commit is contained in:
1 parent
26b3a84b88
commit
b5890b9664
118 files changed
+457
-1923
No files matched your search
@@ -30,7 +30,6 @@ pub(crate) async fn get_event_authorization_route(
|
||||
.await?;
|
||||
|
||||
let event = services
|
||||
.rooms
|
||||
.timeline
|
||||
.get_pdu_json(&body.event_id)
|
||||
.await
|
||||
@@ -45,18 +44,10 @@ pub(crate) async fn get_event_authorization_route(
|
||||
.map_err(|_| Error::bad_database("Invalid room_id in event in database."))?;
|
||||
|
||||
let auth_chain = services
|
||||
.rooms
|
||||
.auth_chain
|
||||
.event_ids_iter(room_id, once(body.event_id.borrow()))
|
||||
.ready_filter_map(Result::ok)
|
||||
.filter_map(async |id| {
|
||||
services
|
||||
.rooms
|
||||
.timeline
|
||||
.get_pdu_json(&id)
|
||||
.await
|
||||
.ok()
|
||||
})
|
||||
.filter_map(async |id| services.timeline.get_pdu_json(&id).await.ok())
|
||||
.then(|pdu| {
|
||||
services
|
||||
.sending
|
||||
|
||||
Reference in new issue
Block a user