1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use types::content::root::types::Presence;
use crate::request::{MatrixRequest, MatrixRequestable};
use http::Method;
use crate::errors::MatrixError;
use futures::Future;
use serde_json::json;
pub struct PresenceManagement;
impl PresenceManagement {
pub fn update_presence<R: MatrixRequestable>(rq: &mut R, p: Presence) -> impl Future<Item = (), Error = MatrixError> {
MatrixRequest::new_with_body_ser(
Method::PUT,
format!("/presence/{}/status", rq.get_user_id()),
json!({
"presence": p
})
).discarding_send(rq)
}
}