mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix errors in api/client/relations.rs
This commit is contained in:
+15
-13
@@ -15,6 +15,7 @@ use ruma::{
|
|||||||
get_relating_events_with_rel_type_and_event_type,
|
get_relating_events_with_rel_type_and_event_type,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
assign,
|
||||||
events::{TimelineEventType, relation::RelationType},
|
events::{TimelineEventType, relation::RelationType},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -39,11 +40,12 @@ pub(crate) async fn get_relating_events_with_rel_type_and_event_type_route(
|
|||||||
body.dir,
|
body.dir,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|res| get_relating_events_with_rel_type_and_event_type::v1::Response {
|
.map(|res| {
|
||||||
chunk: res.chunk,
|
assign!(get_relating_events_with_rel_type_and_event_type::v1::Response::new(res.chunk), {
|
||||||
next_batch: res.next_batch,
|
next_batch: res.next_batch,
|
||||||
prev_batch: res.prev_batch,
|
prev_batch: res.prev_batch,
|
||||||
recursion_depth: res.recursion_depth,
|
recursion_depth: res.recursion_depth,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,11 +68,12 @@ pub(crate) async fn get_relating_events_with_rel_type_route(
|
|||||||
body.dir,
|
body.dir,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|res| get_relating_events_with_rel_type::v1::Response {
|
.map(|res| {
|
||||||
chunk: res.chunk,
|
assign!(get_relating_events_with_rel_type::v1::Response::new(res.chunk), {
|
||||||
next_batch: res.next_batch,
|
next_batch: res.next_batch,
|
||||||
prev_batch: res.prev_batch,
|
prev_batch: res.prev_batch,
|
||||||
recursion_depth: res.recursion_depth,
|
recursion_depth: res.recursion_depth,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,12 +204,11 @@ async fn paginate_relations_with_filter(
|
|||||||
.map(Event::into_format)
|
.map(Event::into_format)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
Ok(get_relating_events::v1::Response {
|
Ok(assign!(get_relating_events::v1::Response::new(chunk), {
|
||||||
next_batch,
|
next_batch,
|
||||||
prev_batch: from.map(Into::into),
|
prev_batch: from.map(Into::into),
|
||||||
recursion_depth: recurse.then_some(depth.into()),
|
recursion_depth: recurse.then_some(depth.into()),
|
||||||
chunk,
|
}))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn visibility_filter<Pdu: Event + Send + Sync>(
|
async fn visibility_filter<Pdu: Event + Send + Sync>(
|
||||||
|
|||||||
Reference in New Issue
Block a user