mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style: Fix clippy
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Result, at, debug_warn, err,
|
Err, Result, at, debug_warn,
|
||||||
matrix::{Event, event::RelationTypeEqual, pdu::PduCount},
|
matrix::{Event, event::RelationTypeEqual, pdu::PduCount},
|
||||||
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
|
utils::{IterStream, ReadyExt, result::FlatOk, stream::WidebandExt},
|
||||||
};
|
};
|
||||||
use conduwuit_service::Services;
|
use conduwuit_service::Services;
|
||||||
use futures::{StreamExt, TryFutureExt};
|
use futures::StreamExt;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
EventId, RoomId, UInt, UserId,
|
EventId, RoomId, UInt, UserId,
|
||||||
api::{
|
api::{
|
||||||
@@ -113,9 +113,10 @@ async fn paginate_relations_with_filter(
|
|||||||
.rooms
|
.rooms
|
||||||
.state_accessor
|
.state_accessor
|
||||||
.user_can_see_event(sender_user, room_id, target)
|
.user_can_see_event(sender_user, room_id, target)
|
||||||
|
.await
|
||||||
{
|
{
|
||||||
debug_warn!(req_evt = ?target, ?room_id, "Event relations requested by {sender_user} but is not allowed to see it, returning 404");
|
debug_warn!(req_evt = ?target, ?room_id, "Event relations requested by {sender_user} but is not allowed to see it, returning 404");
|
||||||
return err!(Request(NotFound("Event not found.")));
|
return Err!(Request(NotFound("Event not found.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
let start: PduCount = from
|
let start: PduCount = from
|
||||||
@@ -138,11 +139,6 @@ async fn paginate_relations_with_filter(
|
|||||||
// Spec (v1.10) recommends depth of at least 3
|
// Spec (v1.10) recommends depth of at least 3
|
||||||
let depth: u8 = if recurse { 3 } else { 1 };
|
let depth: u8 = if recurse { 3 } else { 1 };
|
||||||
|
|
||||||
// Check if this is a thread request
|
|
||||||
let is_thread = filter_rel_type
|
|
||||||
.as_ref()
|
|
||||||
.is_some_and(|rel| *rel == RelationType::Thread);
|
|
||||||
|
|
||||||
let events: Vec<_> = services
|
let events: Vec<_> = services
|
||||||
.rooms
|
.rooms
|
||||||
.pdu_metadata
|
.pdu_metadata
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ pub(crate) async fn search_events_route(
|
|||||||
|
|
||||||
Ok(Response {
|
Ok(Response {
|
||||||
search_categories: ResultCategories {
|
search_categories: ResultCategories {
|
||||||
room_events: room_events_result
|
room_events: Box::pin(room_events_result)
|
||||||
.await
|
.await
|
||||||
.unwrap_or_else(|| Ok(ResultRoomEvents::default()))?,
|
.unwrap_or_else(|| Ok(ResultRoomEvents::default()))?,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user