Telegram-iOS/submodules/TelegramCallsUI/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
..
Components Refactoring 2026-04-03 15:50:39 +08:00
AccountGroupCallContextImpl.swift Glass 2025-12-26 20:29:30 +08:00
CallController.swift Conference 2025-04-11 17:16:36 +04:00
CallControllerButton.swift Various improvements 2025-06-10 22:11:07 +02:00
CallControllerButtonsNode.swift
CallControllerKeyButton.swift
CallControllerKeyPreviewNode.swift
CallControllerNode.swift Various improvements 2024-12-06 22:15:52 +08:00
CallControllerNodeV2.swift Cleanup 2025-06-28 19:48:34 +02:00
CallControllerStatusNode.swift
CallControllerToastNode.swift
CallDebugNode.swift
CallFeedbackController.swift Alerts 2025-12-22 00:19:11 +04:00
CallKitIntegration.swift Update to iOS 13 2025-06-11 16:59:53 +08:00
CallRatingController.swift Alerts 2025-12-22 00:19:11 +04:00
CallRouteActionSheetItem.swift
CallStatusBarNode.swift Glass 2025-12-26 20:29:30 +08:00
CallSuggestTabController.swift Alerts 2025-12-22 00:19:11 +04:00
GroupCallLogs.swift Conference updates 2025-04-07 12:50:23 +04:00
GroupCallScreencast.swift Conference updates 2025-04-07 12:50:23 +04:00
GroupVideoNode.swift
LegacyCallControllerButton.swift
LegacyCallControllerButtonsNode.swift
LegacyCallControllerNode.swift [WIP] Conference calls 2025-02-11 18:46:59 +04:00
LegacyCallControllerStatusNode.swift
MetalVideoRenderingView.swift
PresentationCall.swift Stories 2025-11-07 22:54:56 +08:00
PresentationCallManager.swift Stories 2025-11-07 22:54:56 +08:00
PresentationCallToneData.swift
PresentationGroupCall.swift Alerts 2025-12-22 23:28:04 +04:00
SampleBufferVideoRenderingView.swift [Temp] 2025-01-14 11:52:31 +08:00
ScheduleVideoChatSheetScreen.swift Update API 2026-02-10 12:58:04 +04:00
SharedCallAudioContext.swift Stories 2025-11-06 23:16:55 +04:00
VideoChatActionButtonComponent.swift Glass 2026-01-25 00:31:18 +08:00
VideoChatEncryptionKeyComponent.swift Glass 2026-01-25 00:31:18 +08:00
VideoChatExpandedControlsComponent.swift [WIP] Video chats 2024-09-06 21:41:16 +08:00
VideoChatExpandedParticipantThumbnailsComponent.swift Various improvements 2025-07-09 17:47:56 +04:00
VideoChatExpandedSpeakingToastComponent.swift [WIP] Monoforums 2025-05-08 20:56:55 +01:00
VideoChatListInviteComponent.swift Conference updates 2025-04-04 14:04:52 +04:00
VideoChatMuteIconComponent.swift Video chat improvements 2024-10-01 21:26:30 +08:00
VideoChatParticipantAvatarComponent.swift Various improvements 2025-09-29 06:42:09 +04:00
VideoChatParticipantsComponent.swift Various improvements 2026-03-13 14:54:44 +01:00
VideoChatParticipantStatusComponent.swift Conference update 2025-04-04 22:17:28 +04:00
VideoChatParticipantVideoComponent.swift Various improvements 2026-03-13 14:54:44 +01:00
VideoChatParticipantVideoStatusComponent.swift Video chat UI 2024-09-13 17:59:13 +08:00
VideoChatPinStatusComponent.swift [WIP] Video chats 2024-09-06 21:41:16 +08:00
VideoChatScheduledInfoComponent.swift Glass 2025-12-26 20:29:30 +08:00
VideoChatScreen.swift Refactoring 2026-04-03 15:50:39 +08:00
VideoChatScreenInviteMembers.swift Various improvements 2025-10-11 00:56:21 +08:00
VideoChatScreenMoreMenu.swift Various improvements 2026-03-21 09:47:17 +01:00
VideoChatScreenParticipantContextMenu.swift MediaResource → EngineMediaResource refactor: wave 2 2026-04-17 09:07:54 +02:00
VideoChatTitleComponent.swift Various improvements 2025-09-29 06:42:09 +04:00
VideoChatToasts.swift Various improvements 2025-09-29 06:42:09 +04:00
VideoChatVideoContext.swift [WIP] Video chat v2 2024-09-03 22:34:04 +08:00
VideoChatVideoLoadingEffectView.swift Video chat UI 2024-09-13 17:59:13 +08:00
VideoRenderingContext.swift [WIP] Video chat UI 2024-09-10 19:33:13 +08:00
VoiceChatAccountHeaderActionSheetItem.swift
VoiceChatActionItem.swift Glass 2025-12-26 20:29:30 +08:00
VoiceChatCameraPreviewController.swift Various improvements 2025-10-17 17:01:25 +04:00
VoiceChatController.swift Refactoring 2026-04-03 15:50:39 +08:00
VoiceChatFullscreenParticipantItem.swift Glass 2025-12-26 20:29:30 +08:00
VoiceChatHeaderButton.swift Various improvements 2025-09-22 06:42:19 +04:00
VoiceChatInfoContextItem.swift Various improvements 2026-01-16 21:23:32 +08:00
VoiceChatJoinScreen.swift Refactoring 2026-04-03 15:50:39 +08:00
VoiceChatMainStageNode.swift Glass 2026-01-13 19:21:49 +04:00
VoiceChatMicrophoneNode.swift Glass 2025-12-26 20:29:30 +08:00
VoiceChatOverlayController.swift
VoiceChatParticipantItem.swift Glass 2026-01-13 19:21:49 +04:00
VoiceChatPeerActionSheetItem.swift
VoiceChatPeerProfileNode.swift Glass 2026-01-13 19:21:49 +04:00
VoiceChatPinNode.swift
VoiceChatRecordingContextItem.swift Various improvements 2026-01-16 21:23:32 +08:00
VoiceChatRecordingSetupController.swift Various improvements 2025-10-17 17:01:25 +04:00
VoiceChatShareScreenContextItem.swift Various improvements 2026-03-13 14:54:44 +01:00
VoiceChatSpeakerNode.swift
VoiceChatTileGridNode.swift Glass 2025-12-26 20:29:30 +08:00
VoiceChatTileItemNode.swift
VoiceChatTimerNode.swift Glass 2025-12-26 20:29:30 +08:00
VoiceChatTitleEditController.swift Various improvements 2025-12-23 22:25:44 +04:00
VoiceChatTitleNode.swift
VoiceChatVolumeContextItem.swift Various improvements 2026-01-16 21:23:32 +08:00