mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-30 23:08:10 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
37 lines
1.2 KiB
Swift
37 lines
1.2 KiB
Swift
import Foundation
|
|
import TelegramCore
|
|
import SwiftSignalKit
|
|
|
|
public struct ExperimentalSettings: Codable, Equatable {
|
|
public static var defaultSettings: ExperimentalSettings {
|
|
return ExperimentalSettings()
|
|
}
|
|
|
|
public init() {
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
}
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
}
|
|
|
|
public static func ==(lhs: ExperimentalSettings, rhs: ExperimentalSettings) -> Bool {
|
|
return true
|
|
}
|
|
}
|
|
|
|
public func updateExperimentalSettingsInteractively(accountManager: AccountManager<TelegramAccountManagerTypes>, _ f: @escaping (ExperimentalSettings) -> ExperimentalSettings) -> Signal<Void, NoError> {
|
|
return accountManager.transaction { transaction -> Void in
|
|
transaction.updateSharedData(ApplicationSpecificSharedDataKeys.experimentalSettings, { entry in
|
|
let currentSettings: ExperimentalSettings
|
|
if let entry = entry?.get(ExperimentalSettings.self) {
|
|
currentSettings = entry
|
|
} else {
|
|
currentSettings = ExperimentalSettings.defaultSettings
|
|
}
|
|
return SharedPreferencesEntry(f(currentSettings))
|
|
})
|
|
}
|
|
}
|