allowing the one time keys count to be optional

- for dendrite the field is provided in later syncs
This commit is contained in:
Adam Brown 2022-10-22 19:17:35 +01:00
parent 82f2eea824
commit 4bd75f1bd8
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)