mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 07:28:28 +02:00
Device dehydration v2
- add support for device dehydration v2 i.e. `org.matrix.msc3814` - run dehydration flows after successfully recovering or creating secrets - enable said flows based on .well-known `org.matrix.msc3814` config key - delete previous implementation and helper methods
This commit is contained in:
@@ -24,6 +24,8 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
|
||||
private let recoveryService: MXRecoveryService
|
||||
|
||||
private let dehydrationService: DehydrationService?
|
||||
|
||||
// MARK: Public
|
||||
|
||||
let recoveryGoal: SecretsRecoveryGoal
|
||||
@@ -39,8 +41,9 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(recoveryService: MXRecoveryService, recoveryGoal: SecretsRecoveryGoal) {
|
||||
init(recoveryService: MXRecoveryService, recoveryGoal: SecretsRecoveryGoal, dehydrationService: DehydrationService?) {
|
||||
self.recoveryService = recoveryService
|
||||
self.dehydrationService = dehydrationService
|
||||
self.recoveryGoal = recoveryGoal
|
||||
}
|
||||
|
||||
@@ -103,6 +106,10 @@ final class SecretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphras
|
||||
}
|
||||
self.update(viewState: .loaded)
|
||||
self.coordinatorDelegate?.secretsRecoveryWithPassphraseViewModelDidRecover(self)
|
||||
|
||||
Task {
|
||||
await self.dehydrationService?.runDeviceDehydrationFlow(privateKeyData: privateKey)
|
||||
}
|
||||
}, failure: { [weak self] error in
|
||||
guard let self = self else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user