1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-12-28 20:14:30 +01:00

Merge branch 'conduit/rm-presence-panic' into 'next'

don't panic on missing presence status for a user

See merge request famedly/conduit!565
This commit is contained in:
Timo Kösters 2023-12-24 15:36:36 +00:00
commit 40c7c248fb

View file

@ -1,5 +1,8 @@
use crate::{services, utils, Result, Ruma}; use crate::{services, utils, Error, Result, Ruma};
use ruma::api::client::presence::{get_presence, set_presence}; use ruma::api::client::{
error::ErrorKind,
presence::{get_presence, set_presence},
};
use std::time::Duration; use std::time::Duration;
/// # `PUT /_matrix/client/r0/presence/{userId}/status` /// # `PUT /_matrix/client/r0/presence/{userId}/status`
@ -79,6 +82,9 @@ pub async fn get_presence_route(
presence: presence.content.presence, presence: presence.content.presence,
}) })
} else { } else {
todo!(); Err(Error::BadRequest(
ErrorKind::NotFound,
"Presence state for this user was not found",
))
} }
} }