Make it compile with latest rust lib

This commit is contained in:
ganfra 2022-05-06 19:14:59 +02:00
parent 4e6bed87e4
commit ff17941cee
4 changed files with 11 additions and 6 deletions

View file

@ -168,7 +168,7 @@ internal class OlmMachine(
deviceObserver: DeviceUpdateObserver,
private val requestSender: RequestSender,
) {
private val inner: InnerMachine = InnerMachine(user_id, device_id, path.toString())
private val inner: InnerMachine = InnerMachine(user_id, device_id, path.toString(),null)
private val deviceUpdateObserver = deviceObserver
private val userIdentityUpdateObserver = UserIdentityUpdateObserver()
private val privateKeysUpdateObserver = PrivateCrossSigningKeysUpdateObserver()

View file

@ -179,7 +179,9 @@ internal class QrCodeVerification(
}
if (result != null) {
this.sender.sendVerificationRequest(result.request)
for (request in result.requests) {
this.sender.sendVerificationRequest(request)
}
dispatchTxUpdated()
val signatureRequest = result.signatureRequest

View file

@ -209,7 +209,9 @@ internal class SasVerification(
}
if (result != null) {
this.sender.sendVerificationRequest(result.request)
for (request in result.requests) {
this.sender.sendVerificationRequest(request)
}
dispatchTxUpdated()
val signatureRequest = result.signatureRequest

View file

@ -29,21 +29,22 @@ import uniffi.olm.PickledAccount
import uniffi.olm.PickledInboundGroupSession
import uniffi.olm.PickledSession
import java.nio.charset.Charset
import javax.inject.Inject
private val charset = Charset.forName("UTF-8")
internal class ExtractMigrationDataUseCase() {
internal class ExtractMigrationDataUseCase @Inject constructor() {
operator fun invoke(realm: Realm): MigrationData? {
val pickleKey = OlmUtility.getRandomKey()
val metadataEntity = realm.where<CryptoMetadataEntity>().findFirst() ?: return null
val pickleKey = OlmUtility.getRandomKey()
val olmSessionEntities = realm.where<OlmSessionEntity>().findAll()
val pickledSessions = olmSessionEntities.map { it.toPickledSession(pickleKey) }
val inboundGroupSessionEntities = realm.where<OlmInboundGroupSessionEntity>().findAll()
val pickledInboundGroupSessions = inboundGroupSessionEntities.map { it.toPickledInboundGroupSession(pickleKey) }
val metadataEntity = realm.where<CryptoMetadataEntity>().findFirst() ?: return null
val masterKey = metadataEntity.xSignMasterPrivateKey
val userKey = metadataEntity.xSignUserPrivateKey
val selfSignedKey = metadataEntity.xSignSelfSignedPrivateKey