mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix errors in api/server/event_auth.rs
This commit is contained in:
@@ -1,12 +1,9 @@
|
|||||||
use std::{borrow::Borrow, iter::once};
|
use std::{borrow::Borrow, iter::once};
|
||||||
|
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{Err, Error, Result, info, utils::stream::ReadyExt};
|
use conduwuit::{Err, Error, Result, err, info, utils::stream::ReadyExt};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use ruma::{
|
use ruma::{RoomId, api::federation::authorization::get_event_authorization};
|
||||||
RoomId,
|
|
||||||
api::{client::error::ErrorKind, federation::authorization::get_event_authorization},
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::AccessCheck;
|
use super::AccessCheck;
|
||||||
use crate::Ruma;
|
use crate::Ruma;
|
||||||
@@ -47,7 +44,7 @@ pub(crate) async fn get_event_authorization_route(
|
|||||||
.timeline
|
.timeline
|
||||||
.get_pdu_json(&body.event_id)
|
.get_pdu_json(&body.event_id)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| Error::BadRequest(ErrorKind::NotFound, "Event not found."))?;
|
.map_err(|_| err!(Request(NotFound("Event not found."))))?;
|
||||||
|
|
||||||
let room_id_str = event
|
let room_id_str = event
|
||||||
.get("room_id")
|
.get("room_id")
|
||||||
@@ -67,5 +64,5 @@ pub(crate) async fn get_event_authorization_route(
|
|||||||
.collect()
|
.collect()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
Ok(get_event_authorization::v1::Response { auth_chain })
|
Ok(get_event_authorization::v1::Response::new(auth_chain))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user