mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-05-21 18:20:41 +00:00
2ac8a490b0
Adds AccountManagerResources facade in TelegramCore mirroring TelegramEngine.Resources, drains the entire accountManager-side mediaBox refactor across consumer modules, and validates the Shape-C/D handle-migration pattern (account: Account -> engine: TelegramEngine) on three classes. Wave 94 (AccountManagerResources facade + 8 sites): new AccountManagerResources class in TelegramCore with storeResourceData, completedResourcePath (resource + id overloads), status (with approximateSynchronousValue), moveResourceData, fetch. Migrate EditThemeController (5 storeResourceData + 2 completedResourcePath) and WebBrowserSettingsController (1 storeResourceData). Wave 95 (10 sites): WallpaperUtils.swift sweep, 5 distinct storeResourceData patterns, replace_all on the two repeated ones. Wave 96 (7 sites): theme controller triple — TPC (1 store + 2 moveResourceData), TPCN (1 status + 1 fetch + closure type MediaResourceStatus -> EngineMediaResource.FetchStatus + rename account local to engine), TAC (1 completedResourcePath + 1 store). Wave 97 (9 sites): WallpaperGalleryController.swift, 4 completedResourcePath + 5 storeResourceData via replace_all. Wave 98 (2 files): WallpaperGallery status-type cascade Promise<MediaResourceStatus> -> Promise<EngineMediaResource.FetchStatus> across WallpaperGalleryItem.swift + WallpaperGalleryController.swift. Drops cosmetic `_asStatus()` unwrap. Wave 99 (2 facade extensions + 7 sites): adds AccountManagerResources.data() and approximateSynchronousValue to engine.resources.status(). Migrates OpenResolvedUrl (data + storeResourceData with .complete -> .isComplete cascade), SettingsThemeWallpaperNode (paired engine + accountManager status), WallpaperUploadManager, OpenChatMessage, LiveChatReactionStreamView. Wave 100 (Shape-C/D, free function): legacyWebSearchItem account: Account -> engine: TelegramEngine. 4 files. Wave 101 (Shape-C/D, small class): VerticalListContextResults ChatInputPanelItem stored field migration. 2 files. Drops `|> map(EngineMediaResource.FetchStatus.init)` redundancy. Wave 102 (Shape-C/D, medium class with weak-context retention): SharedMediaPlayer account: Account -> engine: TelegramEngine. Engine field is intentionally a strong handle since the class stores context as `weak var`. 2 files. After this squash the accountManager-side mediaBox refactor is essentially complete; only Postbox-protocol-blocked cachedResourceRepresentation triple remains as the foundational deferred item. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>