FIx / inbound session bad migration

This commit is contained in:
Valere 2020-07-02 14:08:09 +02:00
parent f4314ebdae
commit 69eaf2695e
1 changed files with 3 additions and 2 deletions

View File

@ -182,7 +182,8 @@ internal class RealmCryptoStoreMigration @Inject constructor(private val crossSi
try { try {
val oldSerializedData = obj.getString("olmInboundGroupSessionData") val oldSerializedData = obj.getString("olmInboundGroupSessionData")
deserializeFromRealm<MXOlmInboundGroupSession2>(oldSerializedData)?.let { mxOlmInboundGroupSession2 -> deserializeFromRealm<MXOlmInboundGroupSession2>(oldSerializedData)?.let { mxOlmInboundGroupSession2 ->
val newOlmInboundGroupSessionWrapper2 = OlmInboundGroupSessionWrapper2() val sessionKey = mxOlmInboundGroupSession2.mSession.sessionIdentifier()
val newOlmInboundGroupSessionWrapper = OlmInboundGroupSessionWrapper(sessionKey, false)
.apply { .apply {
olmInboundGroupSession = mxOlmInboundGroupSession2.mSession olmInboundGroupSession = mxOlmInboundGroupSession2.mSession
roomId = mxOlmInboundGroupSession2.mRoomId roomId = mxOlmInboundGroupSession2.mRoomId
@ -191,7 +192,7 @@ internal class RealmCryptoStoreMigration @Inject constructor(private val crossSi
forwardingCurve25519KeyChain = mxOlmInboundGroupSession2.mForwardingCurve25519KeyChain forwardingCurve25519KeyChain = mxOlmInboundGroupSession2.mForwardingCurve25519KeyChain
} }
obj.setString("olmInboundGroupSessionData", serializeForRealm(newOlmInboundGroupSessionWrapper2)) obj.setString("olmInboundGroupSessionData", serializeForRealm(newOlmInboundGroupSessionWrapper))
} }
} catch (e: Exception) { } catch (e: Exception) {
Timber.e(e, "Error") Timber.e(e, "Error")