diff --git a/Podfile.lock b/Podfile.lock index 945985c31..06563390d 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -141,7 +141,7 @@ CHECKOUT OPTIONS: :commit: 714f5ebe199ecc999b33c6f97a4bb57e2db90e75 :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: d1aa253f87d28ddd47ae4612a654de021d865877 + :commit: 25695677d6bad9a13146573108b14885372186f1 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 41b57bb2fc292a814f758441a05243eb38457027 diff --git a/Signal/src/Models/AccountManager.swift b/Signal/src/Models/AccountManager.swift index a568036f1..97f31458e 100644 --- a/Signal/src/Models/AccountManager.swift +++ b/Signal/src/Models/AccountManager.swift @@ -1,5 +1,6 @@ -// Created by Michael Kirk on 10/25/16. -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// import Foundation import PromiseKit @@ -8,13 +9,13 @@ import PromiseKit * Signal is actually two services - textSecure for messages and red phone (for calls). * AccountManager delegates to both. */ -class AccountManager : NSObject { +class AccountManager: NSObject { let TAG = "[AccountManager]" let textSecureAccountManager: TSAccountManager let networkManager: TSNetworkManager let redPhoneAccountManager: RPAccountManager - required init(textSecureAccountManager:TSAccountManager, redPhoneAccountManager:RPAccountManager) { + required init(textSecureAccountManager: TSAccountManager, redPhoneAccountManager: RPAccountManager) { self.networkManager = textSecureAccountManager.networkManager self.textSecureAccountManager = textSecureAccountManager self.redPhoneAccountManager = redPhoneAccountManager @@ -23,7 +24,7 @@ class AccountManager : NSObject { // MARK: registration @objc func register(verificationCode: String) -> AnyPromise { - return AnyPromise(register(verificationCode: verificationCode)); + return AnyPromise(register(verificationCode: verificationCode)) } func register(verificationCode: String) -> Promise { @@ -38,7 +39,7 @@ class AccountManager : NSObject { fulfill() } }.then { - Logger.debug("\(self.TAG) verification code looks well formed."); + Logger.debug("\(self.TAG) verification code looks well formed.") return self.registerForTextSecure(verificationCode: verificationCode) }.then { Logger.debug("\(self.TAG) successfully registered for TextSecure") @@ -53,7 +54,9 @@ class AccountManager : NSObject { private func registerForTextSecure(verificationCode: String) -> Promise { return Promise { fulfill, reject in + let isWebRTCEnabled = Environment.preferences().isWebRTCEnabled() self.textSecureAccountManager.verifyAccount(withCode:verificationCode, + isWebRTCEnabled:isWebRTCEnabled, success:fulfill, failure:reject) } @@ -87,8 +90,8 @@ class AccountManager : NSObject { }.then { Logger.info("\(self.TAG) Successfully updated red phone push tokens.") // TODO code cleanup - convert to `return Promise(value: nil)` and test - return Promise { fulfill, reject in - fulfill(); + return Promise { fulfill, _ in + fulfill() } } } diff --git a/Signal/src/Storyboard/Main.storyboard b/Signal/src/Storyboard/Main.storyboard index ae9ff956b..f3bdf6918 100644 --- a/Signal/src/Storyboard/Main.storyboard +++ b/Signal/src/Storyboard/Main.storyboard @@ -1,11 +1,11 @@ - + - + @@ -431,7 +431,7 @@ - +