Commit 703f7bde authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

account: enable push notifications/proxy by default

Change-Id: I54b94d2d2361cf8d0a02eb7bf0470574be30c71c
parent 553a06a6
......@@ -266,7 +266,7 @@ class CreateAccountViewModel: Stateable, ViewModel {
let password = self.password.value
self.accountService
.addRingAccount(username: username, password: password)
.addRingAccount(username: username, password: password, enable: self.notificationSwitch.value)
.subscribe(onNext: { [unowned self] (account) in
self.accountCreationState.value = .success
DispatchQueue.main.async {
......
......@@ -203,7 +203,7 @@ class AccountsService: AccountAdapterDelegate {
/// - username: an optional username for the new account
/// - password: the required password for the new account
/// - Returns: an observable of an AccountModel: the created one
func addRingAccount(username: String?, password: String) -> Observable<AccountModel> {
func addRingAccount(username: String?, password: String, enable: Bool) -> Observable<AccountModel> {
//~ Single asking the daemon to add a new account with the associated metadata
let createAccountSingle: Single<AccountModel> = Single.create(subscribe: { (single) -> Disposable in
do {
......@@ -214,6 +214,7 @@ class AccountsService: AccountAdapterDelegate {
if !password.isEmpty {
ringDetails.updateValue(password, forKey: ConfigKey.archivePassword.rawValue)
}
ringDetails.updateValue(enable.toString(), forKey: ConfigKey.proxyEnabled.rawValue)
guard let accountId = self.accountAdapter.addAccount(ringDetails) else {
throw AddAccountError.unknownError
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment