From 326641a7e51f927eac1a6cfb20fce807cc9f50a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 20 Apr 2021 14:40:58 +0200 Subject: [PATCH] crypto: Document the requestRoomKey method --- .../matrix/android/sdk/internal/crypto/OlmMachine.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt index ac5a027daa..ecb632be8b 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OlmMachine.kt @@ -372,6 +372,17 @@ internal class OlmMachine(user_id: String, device_id: String, path: File, device } } + /** + * Request the room key that was used to encrypt the given undecrypted + * event. + * + * @param event The that we're not able to decrypt and want to request a + * room key for. + * + * @return a key request pair, consisting of an optional key request + * cancellation and the key request itself. The cancellation *must* be sent + * out before the request, otherwise devices will ignore the key request. + */ @Throws(DecryptionErrorException::class) suspend fun requestRoomKey(event: Event): KeyRequestPair = withContext(Dispatchers.IO) { val adapter = MoshiProvider.providesMoshi().adapter(Event::class.java)