From f28889284db8c153feda4c7d02ec6682d7e87f97 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 4 Jun 2020 11:59:04 +0200 Subject: [PATCH] Wrong /query request (#1444) --- CHANGES.md | 1 + .../android/internal/crypto/model/rest/KeysQueryBody.kt | 2 +- .../android/internal/crypto/tasks/DownloadKeysForUsersTask.kt | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 638b81e0b4..3eeac46193 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Bugfix 🐛: - Switch theme is not fully taken into account without restarting the app - Temporary fix to show error when user is creating an account on matrix.org with userId containing only digits (#1410) - Reply composer overlay stays on screen too long after send (#1169) + - Wrong /query request (#1444) Translations 🗣: - diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeysQueryBody.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeysQueryBody.kt index da2dd781dd..758967d05e 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeysQueryBody.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeysQueryBody.kt @@ -36,7 +36,7 @@ internal data class KeysQueryBody( * A map from user ID, to a list of device IDs, or to an empty list to indicate all devices for the corresponding user. */ @Json(name = "device_keys") - val deviceKeys: Map, + val deviceKeys: Map>, /** * If the client is fetching keys as a result of a device update received in a sync request, this should be the 'since' token diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/DownloadKeysForUsersTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/DownloadKeysForUsersTask.kt index 94fe3c1e8d..5e4b2184b0 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/DownloadKeysForUsersTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/tasks/DownloadKeysForUsersTask.kt @@ -27,7 +27,7 @@ import javax.inject.Inject internal interface DownloadKeysForUsersTask : Task { data class Params( // the list of users to get keys for. - val userIds: List?, + val userIds: List, // the up-to token val token: String? ) @@ -39,7 +39,7 @@ internal class DefaultDownloadKeysForUsers @Inject constructor( ) : DownloadKeysForUsersTask { override suspend fun execute(params: DownloadKeysForUsersTask.Params): KeysQueryResponse { - val downloadQuery = params.userIds?.associateWith { emptyMap() }.orEmpty() + val downloadQuery = params.userIds.associateWith { emptyList() } val body = KeysQueryBody( deviceKeys = downloadQuery,