mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Refactoring
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user