mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-03 22:27:13 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.4 KiB
Swift
37 lines
1.4 KiB
Swift
import Foundation
|
|
import SwiftSignalKit
|
|
import GGCore
|
|
|
|
/// Entry point of the GGProfileExport feature module (W4-1): the GCONNECT nick badge, fake gifts,
|
|
/// chat export.
|
|
public enum GGProfileExportModule {
|
|
private static var fakeGiftsDisposable: Disposable?
|
|
|
|
/// Declares settings, menu rows, hook handlers and migrations. Called once on the main
|
|
/// thread from `GGFeatures.registerAll()`, before `GGHookRegistry.freeze()`.
|
|
public static func register() {
|
|
assert(Thread.isMainThread)
|
|
GGNickBadgeSettings.declare()
|
|
GGFakeGiftsSettings.declare()
|
|
GGChatExportSettings.declare()
|
|
GGFakeGiftsLegacy.registerMigrations()
|
|
|
|
// Nick badge: slots, the network side (off until the user turns badges on), menu.
|
|
GGNickBadgeSlots.register()
|
|
GGNickBadgeMenu.register()
|
|
GGNickBadgeService.shared.start()
|
|
|
|
// Fake gifts: the profile's list, the gift screen's menu, the store per account.
|
|
GGFakeGiftsHooks.register()
|
|
GGFakeGiftsMenu.register()
|
|
GGProfileExportModule.fakeGiftsDisposable = (GGFakeGiftsSettings.isEnabled.signal
|
|
|> distinctUntilChanged).start(next: { enabled in
|
|
GGFakeGiftsStore.shared.setEnabled(enabled)
|
|
})
|
|
|
|
// Chat export: entry points; temporary trees of old jobs are removed off the main thread.
|
|
GGChatExportMenu.register()
|
|
GGChatExportManager.shared.removeStaleJobs()
|
|
}
|
|
}
|