mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +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
|
|
@ -6,7 +6,7 @@ use ruma::{
|
|||
},
|
||||
};
|
||||
|
||||
use crate::{services, Result, Ruma};
|
||||
use crate::{services, Result, Ruma, RumaResponse};
|
||||
|
||||
/// # `POST /_matrix/client/r0/user_directory/search`
|
||||
///
|
||||
|
|
@ -17,7 +17,7 @@ use crate::{services, Result, Ruma};
|
|||
/// and don't share a room with the sender
|
||||
pub(crate) async fn search_users_route(
|
||||
body: Ruma<search_users::v3::Request>,
|
||||
) -> Result<search_users::v3::Response> {
|
||||
) -> Result<RumaResponse<search_users::v3::Response>> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
let limit = body.limit.try_into().unwrap_or(usize::MAX);
|
||||
|
||||
|
|
@ -99,8 +99,8 @@ pub(crate) async fn search_users_route(
|
|||
let results = users.by_ref().take(limit).collect();
|
||||
let limited = users.next().is_some();
|
||||
|
||||
Ok(search_users::v3::Response {
|
||||
Ok(RumaResponse(search_users::v3::Response {
|
||||
results,
|
||||
limited,
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue