fix moshi number parsing for rust

This commit is contained in:
valere 2022-12-01 16:07:28 +01:00
parent 43421e3eb9
commit a110c9ee50
1 changed files with 5 additions and 1 deletions

View File

@ -292,7 +292,11 @@ internal class OlmMachine @Inject constructor(
} }
suspend fun receiveUnencryptedVerificationEvent(roomId: String, event: Event) = withContext(coroutineDispatchers.io) { suspend fun receiveUnencryptedVerificationEvent(roomId: String, event: Event) = withContext(coroutineDispatchers.io) {
val adapter = moshi.adapter(Event::class.java) val adapter = moshi
.newBuilder()
.add(CheckNumberType.JSON_ADAPTER_FACTORY)
.build()
.adapter(Event::class.java)
val serializedEvent = adapter.toJson(event) val serializedEvent = adapter.toJson(event)
inner.receiveUnencryptedVerificationEvent(serializedEvent, roomId) inner.receiveUnencryptedVerificationEvent(serializedEvent, roomId)
} }