Telegram-iOS/submodules/TelegramUI/Sources
Isaac f84e94f507 MediaResource → EngineMediaResource refactor: wave 2
Drive raw `MediaResource` out of the `TelegramEngine` public facade for
photo-upload APIs, and complete a first batch of consumer-side
migrations. Behavior-preserving. The `_internal_*` Postbox-facing
functions are untouched — only the facade signatures change, bridging
inside via `_asResource()` / `EngineMediaResource(_:)`.

TelegramEngine facades migrated (signatures now take EngineMediaResource):
- TelegramEngine.Peers.uploadedPeerPhoto / uploadedPeerVideo
- TelegramEngine.Peers.updatePeerPhoto (closure param too)
- TelegramEngine.AccountData.updateAccountPhoto / updateFallbackPhoto
- TelegramEngine.Contacts.updateContactPhoto
- TelegramEngine.Auth.uploadedPeerVideo

Consumer-side changes:
- MapResourceToAvatarSizes utility: signature is now
  (engine: TelegramEngine, resource: EngineMediaResource, ...). Uses
  engine.resources.data(id:) internally. The submodule drops
  `import Postbox` and the Bazel dep.
- AuthorizationUI: avatar-video signal retyped from
  Signal<TelegramMediaResource?> to Signal<EngineMediaResource?>.
- 27 `mapResourceToAvatarSizes(postbox:...)` call sites across 5
  TelegramUI/TelegramCallsUI files migrated to the new form.

Deferred:
- SaveToCameraRoll (planned Task 8) abandoned — module has three
  public functions taking `postbox: Postbox` (umbrella-type leak,
  banned by rule 2) and requires a full module-migration wave, not a
  type swap. Reason recorded in the wave-2 plan doc.
- Other TelegramEngine facades still leaking MediaResource
  (TelegramEngineStickers.uploadSticker; UploadSecureIdFile.* —
  additionally leaks Postbox) flagged for a future wave.

Docs:
- CLAUDE.md: new rule 7 (TelegramCore never imports UIKit/Display,
  shared with Telegram-Mac), and a new "MediaResource →
  EngineMediaResource consumer migration" section describing the
  wrap/unwrap helpers and the modify-in-place facade-bridging
  pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 09:07:54 +02:00
..
Chat Various fixes 2026-04-15 23:12:53 +02:00
AccountContext.swift Refactoring 2026-04-07 11:31:22 +02:00
AppDelegate.swift [WIP] Polls 2026-03-16 18:07:12 +01:00
ApplicationContext.swift Various improvements 2026-02-23 13:51:13 +04:00
ApplicationShortcutItem.swift
AudioRecordningToneData.swift
ChatBusinessLinkTitlePanelNode.swift Refactoring 2026-04-03 15:50:39 +08:00
ChatController.swift Various fixes 2026-04-15 23:12:53 +02:00
ChatControllerAdminBanUsers.swift Alerts 2025-12-22 00:19:11 +04:00
ChatControllerContentData.swift Update API 2026-04-16 01:18:22 +02:00
ChatControllerDisplayBusinessBotMessageTooltip.swift
ChatControllerDisplayDiceTooltip.swift Various fixes 2025-12-27 21:50:29 +04:00
ChatControllerEditChat.swift Various improvements 2026-02-23 13:51:13 +04:00
ChatControllerForwardMessages.swift Various improvements 2025-10-16 05:30:06 +04:00
ChatControllerKeyShortcuts.swift [WIP] Polls 2026-03-16 18:07:12 +01:00
ChatControllerNode.swift Update API 2026-04-16 01:18:22 +02:00
ChatControllerOpenAttachmentMenu.swift Fix build 2026-04-16 00:03:09 +02:00
ChatControllerOpenCalendarSearch.swift Various improvements 2026-03-31 20:24:24 +08:00
ChatControllerOpenMessageReactionContextMenu.swift Glass 2026-01-13 19:21:49 +04:00
ChatControllerOpenMessageReplies.swift
ChatControllerOpenMessageShareMenu.swift Refactoring 2026-04-03 15:50:39 +08:00
ChatControllerRemoveAd.swift
ChatControllerScrollToPointInHistory.swift Various improvements 2026-01-30 18:50:18 +08:00
ChatControllerTitlePanelNodeContainer.swift
ChatControllerUpdateSearch.swift
ChatHistoryEntriesForView.swift Various fixes 2026-03-28 15:55:50 +01:00
ChatHistoryListNode.swift Update API 2026-04-16 01:18:22 +02:00
ChatHistoryNavigationButtonNode.swift Unseen polls 2026-03-27 18:30:01 +08:00
ChatHistoryNavigationButtons.swift Update 2026-03-27 19:23:09 +08:00
ChatHistoryNavigationStack.swift
ChatHistoryNode.swift
ChatHistoryViewForLocation.swift Various improvements 2026-04-07 16:47:08 +02:00
ChatInterfaceInputContextPanels.swift Glass 2025-12-26 20:29:30 +08:00
ChatInterfaceInputContexts.swift Fix bg 2026-02-17 10:19:02 +04:00
ChatInterfaceInputNodes.swift Refactor text input 2025-09-01 21:45:31 +02:00
ChatInterfaceStateAccessoryPanels.swift [WIP] Polls 2026-03-16 18:07:12 +01:00
ChatInterfaceStateContextMenus.swift Update API 2026-04-16 01:18:22 +02:00
ChatInterfaceStateContextQueries.swift
ChatInterfaceStateInputPanels.swift Disable AI button in secret chats 2026-04-03 13:15:06 +08:00
ChatInterfaceStateNavigationButtons.swift Various improvements 2026-04-10 17:21:36 +02:00
ChatInterfaceTitlePanelNodes.swift AI editing 2026-03-20 18:23:45 +01:00
ChatInviteRequestsTitlePanelNode.swift Glass 2025-12-01 22:13:33 +08:00
ChatLinkPreview.swift
ChatManagingBotTitlePanelNode.swift Glass 2026-01-13 19:21:49 +04:00
ChatMessageActionSheetController.swift
ChatMessageActionSheetControllerNode.swift
ChatMessageActionUrlAuthController.swift
ChatMessageContextControllerContentSource.swift Various improvements 2026-02-19 21:53:26 +04:00
ChatMessageReportInputPanelNode.swift Update 2025-09-17 11:18:26 +04:00
ChatMessageThrottledProcessingManager.swift
ChatMessageTransitionNode.swift Various improvements 2026-04-10 14:30:23 +02:00
ChatOverlayNavigationBar.swift
ChatPinnedMessageTitlePanelNode.swift Various improvements 2026-04-10 17:21:36 +02:00
ChatPremiumRequiredInputPanelNode.swift Update 2025-09-17 11:18:26 +04:00
ChatReportPeerTitlePanelNode.swift Various improvements 2026-03-28 00:11:41 +08:00
ChatRequestInProgressTitlePanelNode.swift Glass 2025-12-01 22:13:33 +08:00
ChatRestrictedInputPanelNode.swift Glass 2026-01-25 00:31:18 +08:00
ChatSearchResultsContollerNode.swift Unseen polls 2026-03-27 18:30:01 +08:00
ChatSearchResultsController.swift Update 2025-11-26 23:05:30 +08:00
ChatSearchState.swift
ChatSearchTitleAccessoryPanelNode.swift Glass 2026-01-13 19:21:49 +04:00
ChatSecretAutoremoveTimerActionSheet.swift
ChatSlowmodeHintController.swift
ChatStatusChecksTooltipContentNode.swift
ChatTagSearchInputPanelNode.swift Fix more elements 2026-01-25 00:55:04 +08:00
ChatToastAlertPanelNode.swift Glass 2025-12-01 22:13:33 +08:00
ChatUnblockInputPanelNode.swift Glass 2026-01-25 00:31:18 +08:00
ChatVerifiedPeerTitlePanelNode.swift Various fixes 2026-04-15 23:12:53 +02:00
CheckDiskSpace.swift
ClearNotificationsManager.swift
CommandChatInputContextPanelNode.swift Unseen polls 2026-03-27 18:30:01 +08:00
CommandChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
CommandMenuChatInputContextPanelNode.swift Refactor 2026-03-10 00:38:36 +01:00
CommandMenuChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
ComposeController.swift Various improvements 2026-04-03 22:15:42 +08:00
ComposeControllerNode.swift Glass 2025-12-10 00:16:36 +08:00
ContactMultiselectionController.swift Glass 2026-01-13 19:21:49 +04:00
ContactMultiselectionControllerNode.swift Various improvements 2026-03-31 22:42:02 +08:00
ContactSelectionController.swift Various fixes 2026-03-02 18:26:12 +04:00
ContactSelectionControllerNode.swift Various fixes 2026-03-23 00:17:18 +01:00
ConvertToWebP.swift
CreateChannelController.swift MediaResource → EngineMediaResource refactor: wave 2 2026-04-17 09:07:54 +02:00
CreateGroupController.swift MediaResource → EngineMediaResource refactor: wave 2 2026-04-17 09:07:54 +02:00
DeleteChatInputPanelNode.swift Update 2025-09-17 11:18:26 +04:00
DeviceContactDataManager.swift New address book implementation 2025-07-09 17:47:33 +04:00
DisabledContextResultsChatInputContextPanelNode.swift
DocumentPreviewController.swift
EditAccessoryPanelNode.swift
EmojisChatInputContextPanelNode.swift Refactor 2026-03-10 00:38:36 +01:00
EmojisChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
FetchCachedRepresentations.swift
FetchResource.swift
GalleryHiddenMediaManager.swift
HashtagChatInputContextPanelNode.swift Refactor 2026-03-10 00:38:36 +01:00
HashtagChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
HorizontalListContextResultsChatInputContextPanelNode.swift Refactor 2026-03-10 00:38:36 +01:00
HorizontalListContextResultsChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
HorizontalStickerGridItem.swift Various fixes 2026-04-15 23:12:53 +02:00
HorizontalStickersChatContextPanelNode.swift Glass 2026-01-13 19:21:49 +04:00
IconButtonNode.swift
ID3ArtworkReader.swift
InChatPrefetchManager.swift
Info.plist
InlineReactionSearchPanel.swift Glass 2026-01-25 00:31:18 +08:00
LargeEmojiActionSheetItem.swift
LegacyDataImportSplash.swift Temp 2025-09-12 10:54:22 +02:00
ListMessagePlaybackOverlayNode.swift
LockedWindowCoveringView.swift Various improvements 2025-07-01 14:57:33 +02:00
MakeTempAccountContext.swift
ManagedAudioRecorder.swift Various improvements 2025-05-24 16:38:39 +02:00
MediaManager.swift Metrics 2026-03-10 11:54:23 +01:00
MentionChatInputContextPanelNode.swift Refactor 2026-03-10 00:38:36 +01:00
MentionChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
MusicListenTracker.swift Various improvements 2026-03-18 00:27:13 +01:00
NavigateToChatController.swift Various fixes 2026-03-28 23:42:30 +01:00
NotificationContainerController.swift
NotificationContainerControllerNode.swift Alerts 2025-12-22 00:19:11 +04:00
NotificationContentContext.swift
NotificationItemContainerNode.swift Various improvements 2026-02-06 15:18:17 +04:00
OpenAddContact.swift Various improvements 2026-04-03 22:15:42 +08:00
OpenChatMessage.swift Various improvements 2026-04-03 22:15:42 +08:00
OpenResolvedUrl.swift Various improvements 2026-04-03 22:15:42 +08:00
OpenUrl.swift AI editing 2026-03-20 18:23:45 +01:00
OverlayAudioPlayerController.swift Refactoring 2026-04-03 15:50:39 +08:00
OverlayAudioPlayerControllerNode.swift Various fixes 2026-04-07 01:44:04 +04:00
OverlayAudioPlayerControlsNode.swift Various fixes 2026-04-02 19:20:15 +02:00
OverlayInstantVideoDecoration.swift
OverlayInstantVideoNode.swift
OverlayMediaController.swift
OverlayMediaControllerNode.swift
PeerMediaCollectionInterfaceState.swift
PeerMediaCollectionInterfaceStateButtons.swift
PeerMediaCollectionSectionsNode.swift
PollResultsController.swift Various improvements 2026-03-30 02:55:35 +02:00
PrefetchManager.swift
PreparedChatHistoryViewTransition.swift [WIP] Polls 2026-03-16 18:07:12 +01:00
ProcessedPeerRestrictionText.swift
RadialProgressNode.swift
RadialTimeoutNode.swift
SaveMediaToFiles.swift [WIP] Saved music 2025-08-21 09:08:35 +04:00
SecretChatHandshakeStatusInputPanelNode.swift Glass 2026-01-25 00:31:18 +08:00
ServiceSoundManager.swift
SharedAccountContext.swift Update API 2026-04-16 01:18:22 +02:00
SharedMediaPlayer.swift Various improvements 2025-08-22 21:46:07 +04:00
SharedNotificationManager.swift
SharedVideoContextManager.swift
SharedWakeupManager.swift Temp 2026-03-13 09:00:55 +01:00
SpotlightContacts.swift
StoreDownloadedMedia.swift Various improvements 2026-02-19 21:53:26 +04:00
SuppressContactsWarning.swift
TelegramRootController.swift Various improvements 2026-03-29 22:18:19 +02:00
TextLinkHandling.swift
ThemeUpdateManager.swift
TonePlayer.swift
TransformOutgoingMessageMedia.swift Various improvements 2026-03-12 13:51:27 +01:00
VerticalListContextResultsChatInputContextPanelNode.swift Refactor 2026-03-10 00:38:36 +01:00
VerticalListContextResultsChatInputPanelButtonItem.swift Glass 2025-12-26 20:29:30 +08:00
VerticalListContextResultsChatInputPanelItem.swift Glass 2025-12-26 20:29:30 +08:00
WallpaperUploadManager.swift
Weak.swift
WebpagePreviewAccessoryPanelNode.swift Glass 2025-09-01 18:44:03 +02:00
WidgetDataContext.swift