mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01:24 +01:00
don't automatically wrap in RumaResponse
This allows us to use the `ruma_route` convenience function even when we need to add our own hacks into the responses, thus making us less reliant on Ruma.
This commit is contained in:
parent
87ac0e2a38
commit
230ebd3884
35 changed files with 438 additions and 405 deletions
|
|
@ -14,7 +14,7 @@ use ruma::{
|
|||
uint,
|
||||
};
|
||||
|
||||
use crate::{services, Error, Result, Ruma};
|
||||
use crate::{services, Error, Result, Ruma, RumaResponse};
|
||||
|
||||
/// # `POST /_matrix/client/r0/search`
|
||||
///
|
||||
|
|
@ -25,7 +25,7 @@ use crate::{services, Error, Result, Ruma};
|
|||
#[allow(clippy::too_many_lines)]
|
||||
pub(crate) async fn search_events_route(
|
||||
body: Ruma<search_events::v3::Request>,
|
||||
) -> Result<search_events::v3::Response> {
|
||||
) -> Result<RumaResponse<search_events::v3::Response>> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
|
||||
let search_criteria = body.search_categories.room_events.as_ref().unwrap();
|
||||
|
|
@ -136,7 +136,7 @@ pub(crate) async fn search_events_route(
|
|||
Some((skip + limit).to_string())
|
||||
};
|
||||
|
||||
Ok(search_events::v3::Response::new(ResultCategories {
|
||||
Ok(RumaResponse(search_events::v3::Response::new(ResultCategories {
|
||||
room_events: ResultRoomEvents {
|
||||
count: None,
|
||||
// TODO
|
||||
|
|
@ -151,5 +151,5 @@ pub(crate) async fn search_events_route(
|
|||
.map(str::to_lowercase)
|
||||
.collect(),
|
||||
},
|
||||
}))
|
||||
})))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue