feat(crypto): Add room_id to RoomPendingKeyBundleDetails
This commit is contained in:
committed by
Richard van der Hoff
parent
096dd59c07
commit
37823df753
@@ -1416,6 +1416,7 @@ macro_rules! cryptostore_integration_tests {
|
||||
rooms_pending_key_bundle: HashMap::from([(
|
||||
test_room.to_owned(),
|
||||
Some(RoomPendingKeyBundleDetails {
|
||||
room_id: test_room.to_owned(),
|
||||
invite_accepted_at: timestamp,
|
||||
inviter: test_user.to_owned(),
|
||||
}),
|
||||
|
||||
@@ -1857,6 +1857,7 @@ impl Store {
|
||||
rooms_pending_key_bundle: HashMap::from([(
|
||||
room_id.to_owned(),
|
||||
Some(RoomPendingKeyBundleDetails {
|
||||
room_id: room_id.to_owned(),
|
||||
invite_accepted_at,
|
||||
inviter: inviter.to_owned(),
|
||||
}),
|
||||
|
||||
@@ -555,6 +555,11 @@ impl From<&StoredRoomKeyBundleData> for RoomKeyBundleInfo {
|
||||
/// invite (and so should accept a room key bundle if we receive one).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct RoomPendingKeyBundleDetails {
|
||||
/// The ID of the room associated with this entry, used to track and
|
||||
/// enumerate all such rooms during the startup process. This enables the
|
||||
/// client to resume importing after a crash.
|
||||
pub room_id: OwnedRoomId,
|
||||
|
||||
/// A timestamp remembering when we observed the user accepting an invite
|
||||
/// using this client.
|
||||
pub invite_accepted_at: MilliSecondsSinceUnixEpoch,
|
||||
|
||||
@@ -508,7 +508,7 @@ impl BundleReceiverTask {
|
||||
|
||||
// If we don't have any invite acceptance details, then this client wasn't the
|
||||
// one that accepted the invite.
|
||||
let Ok(Some(RoomPendingKeyBundleDetails { invite_accepted_at, inviter })) =
|
||||
let Ok(Some(RoomPendingKeyBundleDetails { invite_accepted_at, inviter, .. })) =
|
||||
room.client.base_client().get_pending_key_bundle_details_for_room(room.room_id()).await
|
||||
else {
|
||||
debug!("Not accepting key bundle as there are no recorded invite acceptance details");
|
||||
|
||||
Reference in New Issue
Block a user