update ruma

This commit is contained in:
Jonathan de Jong 2022-02-18 15:33:14 +01:00
parent f3795846b5
commit e9f87e1952
42 changed files with 514 additions and 500 deletions

View file

@ -1,9 +1,6 @@
use crate::{database::DatabaseGuard, Error, Result, Ruma};
use ruma::{
api::client::{
error::ErrorKind,
r0::{read_marker::set_read_marker, receipt::create_receipt},
},
api::client::{error::ErrorKind, read_marker::set_read_marker, receipt::create_receipt},
events::EventType,
receipt::ReceiptType,
MilliSecondsSinceUnixEpoch,
@ -18,8 +15,8 @@ use std::collections::BTreeMap;
/// - If `read_receipt` is set: Update private marker and public read receipt EDU
pub async fn set_read_marker_route(
db: DatabaseGuard,
body: Ruma<set_read_marker::Request<'_>>,
) -> Result<set_read_marker::Response> {
body: Ruma<set_read_marker::v3::Request<'_>>,
) -> Result<set_read_marker::v3::Response> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let fully_read_event = ruma::events::fully_read::FullyReadEvent {
@ -75,7 +72,7 @@ pub async fn set_read_marker_route(
db.flush()?;
Ok(set_read_marker::Response {})
Ok(set_read_marker::v3::Response {})
}
/// # `POST /_matrix/client/r0/rooms/{roomId}/receipt/{receiptType}/{eventId}`
@ -83,8 +80,8 @@ pub async fn set_read_marker_route(
/// Sets private read marker and public read receipt EDU.
pub async fn create_receipt_route(
db: DatabaseGuard,
body: Ruma<create_receipt::Request<'_>>,
) -> Result<create_receipt::Response> {
body: Ruma<create_receipt::v3::Request<'_>>,
) -> Result<create_receipt::v3::Response> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
db.rooms.edus.private_read_set(
@ -126,5 +123,5 @@ pub async fn create_receipt_route(
db.flush()?;
Ok(create_receipt::Response {})
Ok(create_receipt::v3::Response {})
}