Refactoring

This commit is contained in:
Ali
2021-08-12 16:41:11 +02:00
parent adc430b870
commit bf253eec46
84 changed files with 604 additions and 443 deletions

View File

@@ -4,7 +4,7 @@ import TelegramApi
import SwiftSignalKit
public func updateAutodownloadSettingsInteractively(accountManager: AccountManager, _ f: @escaping (AutodownloadSettings) -> AutodownloadSettings) -> Signal<Void, NoError> {
public func updateAutodownloadSettingsInteractively(accountManager: AccountManager<TelegramAccountManagerTypes>, _ f: @escaping (AutodownloadSettings) -> AutodownloadSettings) -> Signal<Void, NoError> {
return accountManager.transaction { transaction -> Void in
transaction.updateSharedData(SharedDataKeys.autodownloadSettings, { entry in
let currentSettings: AutodownloadSettings

View File

@@ -3,7 +3,7 @@ import Postbox
import SwiftSignalKit
public func updateCacheStorageSettingsInteractively(accountManager: AccountManager, _ f: @escaping (CacheStorageSettings) -> CacheStorageSettings) -> Signal<Void, NoError> {
public func updateCacheStorageSettingsInteractively(accountManager: AccountManager<TelegramAccountManagerTypes>, _ f: @escaping (CacheStorageSettings) -> CacheStorageSettings) -> Signal<Void, NoError> {
return accountManager.transaction { transaction -> Void in
transaction.updateSharedData(SharedDataKeys.cacheStorageSettings, { entry in
let currentSettings: CacheStorageSettings

View File

@@ -3,7 +3,7 @@ import Postbox
import SwiftSignalKit
import MtProtoKit
public func updateLoggingSettings(accountManager: AccountManager, _ f: @escaping (LoggingSettings) -> LoggingSettings) -> Signal<Void, NoError> {
public func updateLoggingSettings(accountManager: AccountManager<TelegramAccountManagerTypes>, _ f: @escaping (LoggingSettings) -> LoggingSettings) -> Signal<Void, NoError> {
return accountManager.transaction { transaction -> Void in
var updated: LoggingSettings?
transaction.updateSharedData(SharedDataKeys.loggingSettings, { current in

View File

@@ -3,7 +3,7 @@ import Postbox
import SwiftSignalKit
import MtProtoKit
public func updateProxySettingsInteractively(accountManager: AccountManager, _ f: @escaping (ProxySettings) -> ProxySettings) -> Signal<Bool, NoError> {
public func updateProxySettingsInteractively(accountManager: AccountManager<TelegramAccountManagerTypes>, _ f: @escaping (ProxySettings) -> ProxySettings) -> Signal<Bool, NoError> {
return accountManager.transaction { transaction -> Bool in
return updateProxySettingsInteractively(transaction: transaction, f)
}
@@ -20,7 +20,7 @@ extension ProxyServerSettings {
}
}
public func updateProxySettingsInteractively(transaction: AccountManagerModifier, _ f: @escaping (ProxySettings) -> ProxySettings) -> Bool {
public func updateProxySettingsInteractively(transaction: AccountManagerModifier<TelegramAccountManagerTypes>, _ f: @escaping (ProxySettings) -> ProxySettings) -> Bool {
var hasChanges = false
transaction.updateSharedData(SharedDataKeys.proxySettings, { current in
let previous = (current as? ProxySettings) ?? ProxySettings.defaultSettings