crypto: Connect the room key discarding logic
This commit is contained in:
parent
427eb5e249
commit
8692f05e34
|
@ -543,7 +543,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
}
|
||||
|
||||
override fun discardOutboundSession(roomId: String) {
|
||||
// TODO
|
||||
olmMachine?.discardRoomKey(roomId)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -496,4 +496,11 @@ internal class OlmMachine(user_id: String, device_id: String, path: File, device
|
|||
|
||||
return devices
|
||||
}
|
||||
|
||||
/**
|
||||
* Discard the currently active room key for the given room if there is one.
|
||||
*/
|
||||
fun discardRoomKey(roomId: String) {
|
||||
this.inner.discardRoomKey(roomId)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -450,6 +450,14 @@ impl OlmMachine {
|
|||
})
|
||||
}
|
||||
|
||||
/// Discard the currently active room key for the given room if there is
|
||||
/// one.
|
||||
pub fn discard_room_key(&self, room_id: &str) {
|
||||
let room_id = RoomId::try_from(room_id).unwrap();
|
||||
|
||||
self.inner.invalidate_group_session(&room_id);
|
||||
}
|
||||
|
||||
pub fn start_verification(&self, device: &Device) -> Result<Sas, CryptoStoreError> {
|
||||
let user_id = UserId::try_from(device.user_id.clone()).unwrap();
|
||||
let device_id = device.device_id.as_str().into();
|
||||
|
|
|
@ -127,4 +127,5 @@ interface OlmMachine {
|
|||
[ByRef] string passphrase,
|
||||
ProgressListener progress_listener
|
||||
);
|
||||
void discard_room_key([ByRef] string room_id);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue