Merge pull request #218 from ouchadam/bug/dendrite-infinite-login

Fix dendrite failing to fully login
This commit is contained in:
Adam Brown 2022-10-22 19:35:18 +01:00 committed by GitHub
commit f7f4c897d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ internal data class ApiSyncResponse(
@SerialName("account_data") val accountData: ApiAccountData? = null,
@SerialName("rooms") val rooms: ApiSyncRooms? = null,
@SerialName("to_device") val toDevice: ToDevice? = null,
@SerialName("device_one_time_keys_count") val oneTimeKeysCount: Map<String, ServerKeyCount>,
@SerialName("device_one_time_keys_count") val oneTimeKeysCount: Map<String, ServerKeyCount>? = null,
@SerialName("next_batch") val nextBatch: SyncToken,
@SerialName("prev_batch") val prevBatch: SyncToken? = null,
)

View File

@ -28,7 +28,7 @@ internal class SyncSideEffects(
notifyDevicesUpdated.notifyChanges(it, requestToken)
}
oneTimeKeyProducer.onServerKeyCount(response.oneTimeKeysCount["signed_curve25519"] ?: ServerKeyCount(0))
oneTimeKeyProducer.onServerKeyCount(response.oneTimeKeysCount?.get("signed_curve25519") ?: ServerKeyCount(0))
val decryptedToDeviceEvents = decryptedToDeviceEvents(response)
val roomKeys = handleRoomKeyShares(decryptedToDeviceEvents)