rename RumaResponse to Ra

It's very commonly used so having a short name is worthwhile, I think.
This commit is contained in:
Charles Hall 2024-05-18 18:59:46 -07:00
parent 230ebd3884
commit 7ea98dac72
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
38 changed files with 332 additions and 351 deletions

View file

@ -29,7 +29,7 @@ use tracing::{debug, error};
use crate::{
service::{pdu::EventHash, rooms::timeline::PduCount},
services, utils, Error, PduEvent, Result, Ruma, RumaResponse,
services, utils, Error, PduEvent, Ra, Result, Ruma,
};
/// # `GET /_matrix/client/r0/sync`
@ -74,8 +74,7 @@ use crate::{
#[allow(clippy::too_many_lines)]
pub(crate) async fn sync_events_route(
body: Ruma<sync_events::v3::Request>,
) -> Result<RumaResponse<sync_events::v3::Response>, RumaResponse<UiaaResponse>>
{
) -> Result<Ra<sync_events::v3::Response>, Ra<UiaaResponse>> {
let sender_user = body.sender_user.expect("user is authenticated");
let sender_device = body.sender_device.expect("user is authenticated");
let body = body.body;
@ -458,10 +457,10 @@ pub(crate) async fn sync_events_route(
Ok(x) => x.expect("watcher should succeed"),
Err(error) => debug!(%error, "timed out"),
};
Ok(RumaResponse(response))
Ok(Ra(response))
} else {
// Only cache if we made progress
Ok(RumaResponse(response))
Ok(Ra(response))
}
}
@ -1128,8 +1127,7 @@ fn share_encrypted_room(
#[allow(clippy::too_many_lines)]
pub(crate) async fn sync_events_v4_route(
body: Ruma<sync_events::v4::Request>,
) -> Result<RumaResponse<sync_events::v4::Response>, RumaResponse<UiaaResponse>>
{
) -> Result<Ra<sync_events::v4::Response>, Ra<UiaaResponse>> {
let sender_user = body.sender_user.expect("user is authenticated");
let sender_device = body.sender_device.expect("user is authenticated");
let mut body = body.body;
@ -1702,7 +1700,7 @@ pub(crate) async fn sync_events_v4_route(
};
}
Ok(RumaResponse(sync_events::v4::Response {
Ok(Ra(sync_events::v4::Response {
initial: globalsince == 0,
txn_id: body.txn_id.clone(),
pos: next_batch.to_string(),