Update ruma version

This commit is contained in:
Timo Kösters 2020-09-08 17:32:03 +02:00
parent 2a63d0955a
commit 1e8fbd8d50
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
33 changed files with 147 additions and 169 deletions

View file

@ -1,5 +1,6 @@
use super::State;
use crate::{utils, ConduitResult, Database, Ruma};
use create_typing_event::Typing;
use ruma::api::client::r0::typing::create_typing_event;
#[cfg(feature = "conduit_bin")]
@ -11,16 +12,15 @@ use rocket::put;
)]
pub fn create_typing_event_route(
db: State<'_, Database>,
body: Ruma<create_typing_event::Request>,
body: Ruma<create_typing_event::Request<'_>>,
) -> ConduitResult<create_typing_event::Response> {
let sender_id = body.sender_id.as_ref().expect("user is authenticated");
if body.typing {
if let Typing::Yes(duration) = body.state {
db.rooms.edus.roomactive_add(
&sender_id,
&body.room_id,
body.timeout.map(|d| d.as_millis() as u64).unwrap_or(30000)
+ utils::millis_since_unix_epoch(),
duration.as_millis() as u64 + utils::millis_since_unix_epoch(),
&db.globals,
)?;
} else {