mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-20 09:11:24 +01:00
Use self instead of going through services()
This commit is contained in:
parent
f52cf53931
commit
341f4213d0
8 changed files with 26 additions and 60 deletions
|
|
@ -45,12 +45,7 @@ impl Service {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(
|
||||
clippy::too_many_arguments,
|
||||
clippy::too_many_lines,
|
||||
// Allowed because this function uses `services()`
|
||||
clippy::unused_self,
|
||||
)]
|
||||
#[allow(clippy::too_many_arguments, clippy::too_many_lines)]
|
||||
#[tracing::instrument(skip(self))]
|
||||
pub(crate) fn paginate_relations_with_filter(
|
||||
&self,
|
||||
|
|
@ -69,9 +64,7 @@ impl Service {
|
|||
match ruma::api::Direction::Backward {
|
||||
ruma::api::Direction::Forward => {
|
||||
// TODO: should be relations_after
|
||||
let events_after: Vec<_> = services()
|
||||
.rooms
|
||||
.pdu_metadata
|
||||
let events_after: Vec<_> = self
|
||||
.relations_until(sender_user, room_id, target, from)?
|
||||
.filter(|r| {
|
||||
r.as_ref().map_or(true, |(_, pdu)| {
|
||||
|
|
@ -126,9 +119,7 @@ impl Service {
|
|||
})
|
||||
}
|
||||
ruma::api::Direction::Backward => {
|
||||
let events_before: Vec<_> = services()
|
||||
.rooms
|
||||
.pdu_metadata
|
||||
let events_before: Vec<_> = self
|
||||
.relations_until(sender_user, room_id, target, from)?
|
||||
.filter(|r| {
|
||||
r.as_ref().map_or(true, |(_, pdu)| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue