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
557d119b
Commit
557d119b
authored
3 years ago
by
Jonathan de Jong
Browse files
Options
Downloads
Patches
Plain Diff
change search_events_v3 to search_events::v3
parent
e9f87e19
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/client_server/search.rs
+6
-6
6 additions, 6 deletions
src/client_server/search.rs
with
6 additions
and
6 deletions
src/client_server/search.rs
+
6
−
6
View file @
557d119b
use
crate
::{
database
::
DatabaseGuard
,
Error
,
Result
,
Ruma
};
use
crate
::{
database
::
DatabaseGuard
,
Error
,
Result
,
Ruma
};
use
ruma
::
api
::
client
::{
use
ruma
::
api
::
client
::{
error
::
ErrorKind
,
error
::
ErrorKind
,
search
::
search_events
::
v3
::
{
search
::
search_events
::{
self
as
search_events_v3
,
EventContextResult
,
ResultCategories
,
ResultRoomEvents
,
self
,
SearchResult
,
v3
::{
EventContextResult
,
ResultCategories
,
ResultRoomEvents
,
SearchResult
}
,
},
},
};
};
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
/// - Only works if the user is currently joined to the room (TODO: Respect history visibility)
/// - Only works if the user is currently joined to the room (TODO: Respect history visibility)
pub
async
fn
search_events_route
(
pub
async
fn
search_events_route
(
db
:
DatabaseGuard
,
db
:
DatabaseGuard
,
body
:
Ruma
<
search_events
_
v3
::
Request
<
'_
>>
,
body
:
Ruma
<
search_events
::
v3
::
Request
<
'_
>>
,
)
->
Result
<
search_events
_
v3
::
Response
>
{
)
->
Result
<
search_events
::
v3
::
Response
>
{
let
sender_user
=
body
.sender_user
.as_ref
()
.expect
(
"user is authenticated"
);
let
sender_user
=
body
.sender_user
.as_ref
()
.expect
(
"user is authenticated"
);
let
search_criteria
=
body
.search_categories.room_events
.as_ref
()
.unwrap
();
let
search_criteria
=
body
.search_categories.room_events
.as_ref
()
.unwrap
();
...
@@ -102,7 +102,7 @@ pub async fn search_events_route(
...
@@ -102,7 +102,7 @@ pub async fn search_events_route(
Some
((
skip
+
limit
)
.to_string
())
Some
((
skip
+
limit
)
.to_string
())
};
};
Ok
(
search_events
_
v3
::
Response
::
new
(
ResultCategories
{
Ok
(
search_events
::
v3
::
Response
::
new
(
ResultCategories
{
room_events
:
ResultRoomEvents
{
room_events
:
ResultRoomEvents
{
count
:
Some
((
results
.len
()
as
u32
)
.into
()),
// TODO: set this to none. Element shouldn't depend on it
count
:
Some
((
results
.len
()
as
u32
)
.into
()),
// TODO: set this to none. Element shouldn't depend on it
groups
:
BTreeMap
::
new
(),
// TODO
groups
:
BTreeMap
::
new
(),
// TODO
...
...
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