Files
GLEGram-iOS/submodules/TelegramCore/Sources/AccountManager/AccountSharedData.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

38 lines
1.2 KiB
Swift

import Foundation
import Postbox
final class MutableAccountSharedDataView<Types: AccountManagerTypes> {
private let keys: Set<ValueBoxKey>
fileprivate var entries: [ValueBoxKey: PreferencesEntry] = [:]
init(accountManagerImpl: AccountManagerImpl<Types>, keys: Set<ValueBoxKey>) {
self.keys = keys
for key in keys {
if let value = accountManagerImpl.sharedDataTable.get(key: key) {
self.entries[key] = value
}
}
}
func replay(accountManagerImpl: AccountManagerImpl<Types>, updatedKeys: Set<ValueBoxKey>) -> Bool {
var updated = false
for key in updatedKeys.intersection(self.keys) {
if let value = accountManagerImpl.sharedDataTable.get(key: key) {
self.entries[key] = value
} else {
self.entries.removeValue(forKey: key)
}
updated = true
}
return updated
}
}
public final class AccountSharedDataView<Types: AccountManagerTypes> {
public let entries: [ValueBoxKey: PreferencesEntry]
init(_ view: MutableAccountSharedDataView<Types>) {
self.entries = view.entries
}
}