IOS-1542 AccountVerificationServiceDelegate not used anymore. IOS-1542
authorDirk Zimmermann <dz@pep.security>
Thu, 25 Apr 2019 16:25:40 +0200
branchIOS-1542
changeset 8381907e287ead66
parent 8380 fd237aaceec6
child 8382 855ff0a20d53
IOS-1542 AccountVerificationServiceDelegate not used anymore.
pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift
pEpForiOSTests/Models/Settings/AccountSettingsViewModelTest.swift
     1.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Thu Apr 25 16:25:40 2019 +0200
     1.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Thu Apr 25 16:25:40 2019 +0200
     1.3 @@ -198,27 +198,6 @@
     1.4      }
     1.5  }
     1.6  
     1.7 -// MARK: - AccountVerificationServiceDelegate
     1.8 -
     1.9 -extension AccountSettingsViewModel: AccountVerificationServiceDelegate {
    1.10 -    public func verified(account: Account,
    1.11 -                  service: AccountVerificationServiceProtocol,
    1.12 -                  result: AccountVerificationResult) {
    1.13 -        if result == .ok {
    1.14 -            MessageModelUtil.performAndWait {
    1.15 -                account.save()
    1.16 -            }
    1.17 -        }
    1.18 -        GCD.onMainWait { [weak self] in
    1.19 -            guard let me = self else {
    1.20 -                Logger.frontendLogger.lostMySelf()
    1.21 -                return
    1.22 -            }
    1.23 -            me.delegate?.didVerify(result: result, accountInput: nil)
    1.24 -        }
    1.25 -    }
    1.26 -}
    1.27 -
    1.28  // MARK: - VerifiableAccountDelegate
    1.29  
    1.30  extension AccountSettingsViewModel: VerifiableAccountDelegate {
     2.1 --- a/pEpForiOSTests/Models/Settings/AccountSettingsViewModelTest.swift	Thu Apr 25 16:25:40 2019 +0200
     2.2 +++ b/pEpForiOSTests/Models/Settings/AccountSettingsViewModelTest.swift	Thu Apr 25 16:25:40 2019 +0200
     2.3 @@ -133,9 +133,7 @@
     2.4          delegate.expectationDidVerifyCalled = verifyExpectation
     2.5          viewModel.delegate = delegate
     2.6  
     2.7 -        viewModel.verified(account: account,
     2.8 -                           service: AccountVerificationService(),
     2.9 -                           result: .ok)
    2.10 +        viewModel.didEndVerification(result: .success(()))
    2.11  
    2.12          waitForExpectations(timeout: UnitTestUtils.waitTime)
    2.13      }