Merge pull request #2239 from vector-im/feature/bca/fix_missing_adapters

Fix / Moshi Cannot serialize kotlin
This commit is contained in:
Benoit Marty 2020-10-09 15:45:31 +02:00 committed by GitHub
commit c9223ff74c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -50,7 +50,7 @@ import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.Membership import org.matrix.android.sdk.api.session.room.model.Membership
import org.matrix.android.sdk.api.session.room.model.RoomHistoryVisibility import org.matrix.android.sdk.api.session.room.model.RoomHistoryVisibility
import org.matrix.android.sdk.api.session.room.model.RoomHistoryVisibilityContent import org.matrix.android.sdk.api.session.room.model.RoomHistoryVisibilityContent
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary import org.matrix.android.sdk.api.session.room.model.RoomMemberContent
import org.matrix.android.sdk.internal.crypto.actions.EnsureOlmSessionsForDevicesAction import org.matrix.android.sdk.internal.crypto.actions.EnsureOlmSessionsForDevicesAction
import org.matrix.android.sdk.internal.crypto.actions.MegolmSessionDataImporter import org.matrix.android.sdk.internal.crypto.actions.MegolmSessionDataImporter
import org.matrix.android.sdk.internal.crypto.actions.MessageEncrypter import org.matrix.android.sdk.internal.crypto.actions.MessageEncrypter
@ -953,7 +953,7 @@ internal class DefaultCryptoService @Inject constructor(
roomEncryptorsStore.get(roomId) ?: /* No encrypting in this room */ return roomEncryptorsStore.get(roomId) ?: /* No encrypting in this room */ return
event.stateKey?.let { userId -> event.stateKey?.let { userId ->
val roomMember: RoomMemberSummary? = event.content.toModel() val roomMember: RoomMemberContent? = event.content.toModel()
val membership = roomMember?.membership val membership = roomMember?.membership
if (membership == Membership.JOIN) { if (membership == Membership.JOIN) {
// make sure we are tracking the deviceList for this user. // make sure we are tracking the deviceList for this user.

View File

@ -16,6 +16,9 @@
package org.matrix.android.sdk.internal.crypto.model.rest package org.matrix.android.sdk.internal.crypto.model.rest
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
internal data class SendToDeviceBody( internal data class SendToDeviceBody(
/** /**
* `Any` should implement [SendToDeviceObject], but we cannot use interface here because of Json serialization * `Any` should implement [SendToDeviceObject], but we cannot use interface here because of Json serialization