Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
fa71dd4b
Commit
fa71dd4b
authored
11 months ago
by
🥺
Committed by
🥺
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
use body.dir for relations now
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
92dbe826
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/client_server/relations.rs
+16
-7
16 additions, 7 deletions
src/api/client_server/relations.rs
src/service/rooms/pdu_metadata/mod.rs
+5
-6
5 additions, 6 deletions
src/service/rooms/pdu_metadata/mod.rs
with
21 additions
and
13 deletions
src/api/client_server/relations.rs
+
16
−
7
View file @
fa71dd4b
...
...
@@ -12,8 +12,7 @@ pub async fn get_relating_events_with_rel_type_and_event_type_route(
let
from
=
match
body
.from
.clone
()
{
Some
(
from
)
=>
PduCount
::
try_from_string
(
&
from
)
?
,
None
=>
match
ruma
::
api
::
Direction
::
Backward
{
// TODO: fix ruma so `body.dir` exists
None
=>
match
body
.dir
{
ruma
::
api
::
Direction
::
Forward
=>
PduCount
::
min
(),
ruma
::
api
::
Direction
::
Backward
=>
PduCount
::
max
(),
},
...
...
@@ -41,6 +40,7 @@ pub async fn get_relating_events_with_rel_type_and_event_type_route(
&
Some
(
body
.event_type
.clone
()),
&
Some
(
body
.rel_type
.clone
()),
from
,
body
.dir
,
to
,
limit
,
)
?
;
...
...
@@ -61,8 +61,7 @@ pub async fn get_relating_events_with_rel_type_route(
let
from
=
match
body
.from
.clone
()
{
Some
(
from
)
=>
PduCount
::
try_from_string
(
&
from
)
?
,
None
=>
match
ruma
::
api
::
Direction
::
Backward
{
// TODO: fix ruma so `body.dir` exists
None
=>
match
body
.dir
{
ruma
::
api
::
Direction
::
Forward
=>
PduCount
::
min
(),
ruma
::
api
::
Direction
::
Backward
=>
PduCount
::
max
(),
},
...
...
@@ -90,6 +89,7 @@ pub async fn get_relating_events_with_rel_type_route(
&
None
,
&
Some
(
body
.rel_type
.clone
()),
from
,
body
.dir
,
to
,
limit
,
)
?
;
...
...
@@ -110,8 +110,7 @@ pub async fn get_relating_events_route(
let
from
=
match
body
.from
.clone
()
{
Some
(
from
)
=>
PduCount
::
try_from_string
(
&
from
)
?
,
None
=>
match
ruma
::
api
::
Direction
::
Backward
{
// TODO: fix ruma so `body.dir` exists
None
=>
match
body
.dir
{
ruma
::
api
::
Direction
::
Forward
=>
PduCount
::
min
(),
ruma
::
api
::
Direction
::
Backward
=>
PduCount
::
max
(),
},
...
...
@@ -132,5 +131,15 @@ pub async fn get_relating_events_route(
services
()
.rooms
.pdu_metadata
.paginate_relations_with_filter
(
sender_user
,
&
body
.room_id
,
&
body
.event_id
,
&
None
,
&
None
,
from
,
to
,
limit
)
.paginate_relations_with_filter
(
sender_user
,
&
body
.room_id
,
&
body
.event_id
,
&
None
,
&
None
,
from
,
body
.dir
,
to
,
limit
,
)
}
This diff is collapsed.
Click to expand it.
src/service/rooms/pdu_metadata/mod.rs
+
5
−
6
View file @
fa71dd4b
...
...
@@ -3,7 +3,7 @@
pub
use
data
::
Data
;
use
ruma
::{
api
::
client
::
relations
::
get_relating_events
,
api
::
{
client
::
relations
::
get_relating_events
,
Direction
},
events
::{
relation
::
RelationType
,
TimelineEventType
},
EventId
,
RoomId
,
UserId
,
};
...
...
@@ -42,13 +42,12 @@ pub fn add_relation(&self, from: PduCount, to: PduCount) -> Result<()> {
#[allow(clippy::too_many_arguments)]
pub
fn
paginate_relations_with_filter
(
&
self
,
sender_user
:
&
UserId
,
room_id
:
&
RoomId
,
target
:
&
EventId
,
filter_event_type
:
&
Option
<
TimelineEventType
>
,
filter_rel_type
:
&
Option
<
RelationType
>
,
from
:
PduCount
,
to
:
Option
<
PduCount
>
,
limit
:
usize
,
filter_rel_type
:
&
Option
<
RelationType
>
,
from
:
PduCount
,
dir
:
Direction
,
to
:
Option
<
PduCount
>
,
limit
:
usize
,
)
->
Result
<
get_relating_events
::
v1
::
Response
>
{
let
next_token
;
//TODO: Fix ruma: match body.dir {
match
ruma
::
api
::
Direction
::
Backward
{
ruma
::
api
::
Direction
::
Forward
=>
{
match
dir
{
Direction
::
Forward
=>
{
let
events_after
:
Vec
<
_
>
=
services
()
.rooms
.pdu_metadata
...
...
@@ -94,7 +93,7 @@ pub fn paginate_relations_with_filter(
recursion_depth
:
None
,
// TODO
})
},
ruma
::
api
::
Direction
::
Backward
=>
{
Direction
::
Backward
=>
{
let
events_before
:
Vec
<
_
>
=
services
()
.rooms
.pdu_metadata
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment