Skip to content

Commit b4b010f

Browse files
committed
fix(crypto): Do a keys query before we accept historic room key bundles
1 parent 536ba51 commit b4b010f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/matrix-sdk/src/room/shared_room_history.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ pub(crate) async fn maybe_accept_key_bundle(room: &Room, inviter: &UserId) -> Re
130130

131131
tracing::Span::current().record("bundle_sender", bundle_info.sender_user.as_str());
132132

133+
// Ensure that we get a fresh list of devices for the inviter, in case we need
134+
// to recalculate the `SenderData`.
135+
let (req_id, request) =
136+
olm_machine.query_keys_for_users(iter::once(bundle_info.sender_user.as_ref()));
137+
138+
if !request.device_keys.is_empty() {
139+
room.client.keys_query(&req_id, request.device_keys).await?;
140+
}
141+
133142
let bundle_content = client
134143
.media()
135144
.get_media_content(

0 commit comments

Comments
 (0)