mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
rename RumaResponse to Ra
It's very commonly used so having a short name is worthwhile, I think.
This commit is contained in:
parent
230ebd3884
commit
7ea98dac72
38 changed files with 332 additions and 351 deletions
|
|
@ -11,14 +11,14 @@ use ruma::{
|
|||
OwnedRoomAliasId,
|
||||
};
|
||||
|
||||
use crate::{services, Error, Result, Ruma, RumaResponse};
|
||||
use crate::{services, Error, Ra, Result, Ruma};
|
||||
|
||||
/// # `PUT /_matrix/client/r0/directory/room/{roomAlias}`
|
||||
///
|
||||
/// Creates a new room alias on this server.
|
||||
pub(crate) async fn create_alias_route(
|
||||
body: Ruma<create_alias::v3::Request>,
|
||||
) -> Result<RumaResponse<create_alias::v3::Response>> {
|
||||
) -> Result<Ra<create_alias::v3::Response>> {
|
||||
if body.room_alias.server_name() != services().globals.server_name() {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::InvalidParam,
|
||||
|
|
@ -46,7 +46,7 @@ pub(crate) async fn create_alias_route(
|
|||
|
||||
services().rooms.alias.set_alias(&body.room_alias, &body.room_id)?;
|
||||
|
||||
Ok(RumaResponse(create_alias::v3::Response::new()))
|
||||
Ok(Ra(create_alias::v3::Response::new()))
|
||||
}
|
||||
|
||||
/// # `DELETE /_matrix/client/r0/directory/room/{roomAlias}`
|
||||
|
|
@ -57,7 +57,7 @@ pub(crate) async fn create_alias_route(
|
|||
/// - TODO: Update canonical alias event
|
||||
pub(crate) async fn delete_alias_route(
|
||||
body: Ruma<delete_alias::v3::Request>,
|
||||
) -> Result<RumaResponse<delete_alias::v3::Response>> {
|
||||
) -> Result<Ra<delete_alias::v3::Response>> {
|
||||
if body.room_alias.server_name() != services().globals.server_name() {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::InvalidParam,
|
||||
|
|
@ -83,7 +83,7 @@ pub(crate) async fn delete_alias_route(
|
|||
|
||||
// TODO: update alt_aliases?
|
||||
|
||||
Ok(RumaResponse(delete_alias::v3::Response::new()))
|
||||
Ok(Ra(delete_alias::v3::Response::new()))
|
||||
}
|
||||
|
||||
/// # `GET /_matrix/client/r0/directory/room/{roomAlias}`
|
||||
|
|
@ -93,8 +93,8 @@ pub(crate) async fn delete_alias_route(
|
|||
/// - TODO: Suggest more servers to join via
|
||||
pub(crate) async fn get_alias_route(
|
||||
body: Ruma<get_alias::v3::Request>,
|
||||
) -> Result<RumaResponse<get_alias::v3::Response>> {
|
||||
get_alias_helper(body.body.room_alias).await.map(RumaResponse)
|
||||
) -> Result<Ra<get_alias::v3::Response>> {
|
||||
get_alias_helper(body.body.room_alias).await.map(Ra)
|
||||
}
|
||||
|
||||
pub(crate) async fn get_alias_helper(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue