Files
GLEGram-iOS/submodules/TelegramCore/Sources/ApiUtils/RemoteStorageConfiguration.swift
T
Leeksov 4647310322 GLEGram 12.5 — Initial public release
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.
2026-04-06 09:48:12 +03:00

28 lines
1.0 KiB
Swift

import Foundation
import Postbox
import SwiftSignalKit
func currentWebDocumentsHostDatacenterId(postbox: Postbox, isTestingEnvironment: Bool) -> Signal<Int32, NoError> {
return postbox.transaction { transaction -> Int32 in
if let entry = transaction.getPreferencesEntry(key: PreferencesKeys.remoteStorageConfiguration)?.get(RemoteStorageConfiguration.self) {
return entry.webDocumentsHostDatacenterId
} else {
if isTestingEnvironment {
return 2
} else {
return 4
}
}
}
}
func updateRemoteStorageConfiguration(transaction: Transaction, configuration: RemoteStorageConfiguration) {
let current = transaction.getPreferencesEntry(key: PreferencesKeys.remoteStorageConfiguration)?.get(RemoteStorageConfiguration.self)
if let current = current, current == configuration {
return
}
transaction.setPreferencesEntry(key: PreferencesKeys.remoteStorageConfiguration, value: PreferencesEntry(configuration))
}