Merge pull request #1449 from vector-im/feature/fix_1444

Wrong /query request (#1444)
This commit is contained in:
Benoit Marty 2020-06-08 18:07:23 +02:00 committed by GitHub
commit e7ba0a5c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -18,6 +18,7 @@ Bugfix 🐛:
- Reply composer overlay stays on screen too long after send (#1169) - Reply composer overlay stays on screen too long after send (#1169)
- Fix navigation bar icon contrast on API in [21,27[ (#1342) - Fix navigation bar icon contrast on API in [21,27[ (#1342)
- Fix status bar icon contrast on API in [21,23[ - Fix status bar icon contrast on API in [21,23[
- Wrong /query request (#1444)
Translations 🗣: Translations 🗣:
- -

View File

@ -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. * 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") @Json(name = "device_keys")
val deviceKeys: Map<String, Any>, val deviceKeys: Map<String, List<String>>,
/** /**
* If the client is fetching keys as a result of a device update received in a sync request, this should be the 'since' token * If the client is fetching keys as a result of a device update received in a sync request, this should be the 'since' token

View File

@ -27,7 +27,7 @@ import javax.inject.Inject
internal interface DownloadKeysForUsersTask : Task<DownloadKeysForUsersTask.Params, KeysQueryResponse> { internal interface DownloadKeysForUsersTask : Task<DownloadKeysForUsersTask.Params, KeysQueryResponse> {
data class Params( data class Params(
// the list of users to get keys for. // the list of users to get keys for.
val userIds: List<String>?, val userIds: List<String>,
// the up-to token // the up-to token
val token: String? val token: String?
) )
@ -39,7 +39,7 @@ internal class DefaultDownloadKeysForUsers @Inject constructor(
) : DownloadKeysForUsersTask { ) : DownloadKeysForUsersTask {
override suspend fun execute(params: DownloadKeysForUsersTask.Params): KeysQueryResponse { override suspend fun execute(params: DownloadKeysForUsersTask.Params): KeysQueryResponse {
val downloadQuery = params.userIds?.associateWith { emptyMap<String, Any>() }.orEmpty() val downloadQuery = params.userIds.associateWith { emptyList<String>() }
val body = KeysQueryBody( val body = KeysQueryBody(
deviceKeys = downloadQuery, deviceKeys = downloadQuery,