fix: send devicekeyupdate users in /sync

This commit is contained in:
timokoesters 2020-05-18 11:36:32 +02:00
parent f0aed35ecf
commit 42ae433b25
No known key found for this signature in database
GPG key ID: 356E705610F626D5
3 changed files with 28 additions and 8 deletions

View file

@ -714,7 +714,7 @@ pub fn upload_keys_route(
if let Some(device_keys) = &body.device_keys {
db.users
.add_device_keys(user_id, device_id, device_keys)
.add_device_keys(user_id, device_id, device_keys, &db.globals)
.unwrap();
}
@ -1640,7 +1640,18 @@ pub fn sync_route(
.map(|(_, v)| v)
.collect(),
},
device_lists: Default::default(),
device_lists: if since != 0 {
Some(sync_events::DeviceLists {
changed: db
.users
.device_keys_changed(since)
.map(|u| u.unwrap().to_string())
.collect(), // TODO: use userids when ruma changes
left: Vec::new(), // TODO
})
} else {
None // TODO: left
},
device_one_time_keys_count: Default::default(),
to_device: sync_events::ToDevice {
events: db
@ -1762,10 +1773,6 @@ pub fn get_media_config_route() -> MatrixResult<get_media_config::Response> {
#[options("/<_segments..>")]
pub fn options_route(
_segments: rocket::http::uri::Segments<'_>,
) -> MatrixResult<create_message_event::Response> {
MatrixResult(Err(Error {
kind: ErrorKind::NotFound,
message: "".to_owned(),
status_code: http::StatusCode::OK,
}))
) -> MatrixResult<send_event_to_device::Response> {
MatrixResult(Ok(send_event_to_device::Response))
}