diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiSyncResponse.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiSyncResponse.kt index 2bc14c2..39b8a90 100644 --- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiSyncResponse.kt +++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/request/ApiSyncResponse.kt @@ -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, + @SerialName("device_one_time_keys_count") val oneTimeKeysCount: Map? = null, @SerialName("next_batch") val nextBatch: SyncToken, @SerialName("prev_batch") val prevBatch: SyncToken? = null, ) diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/room/SyncSideEffects.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/room/SyncSideEffects.kt index f08dd1d..ad02e65 100644 --- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/room/SyncSideEffects.kt +++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/room/SyncSideEffects.kt @@ -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)