13 Commits

Author SHA1 Message Date
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
Ali 31bc746984 Fix more warnings 2021-08-05 01:42:59 +02:00
Ali 1a04fb4408 Refactor SyncCore back into TelegramCore 2021-07-21 21:43:20 +02:00
Ali 2805b1715c Cleanup 2020-12-17 16:36:55 +04:00
Ali f57d6b6168 Temp 2020-02-20 18:08:36 +04:00
Ilya Laktyushin 62ae89d18b Various theming fixes 2019-12-16 10:33:16 +04:00
Ali a66f13d969 Support PixelDimensions 2019-11-03 00:44:55 +04:00
Peter 10692a323e Refactor SyncCore 2019-10-21 16:58:00 +04:00
Peter 8181fbb1a6 Remove projects 2019-10-04 13:58:00 +04:00
Peter e34bf0680a Temp 2019-08-27 00:44:36 +04:00
Peter d701ec80e5 Temp 2019-08-26 04:28:26 +04:00
Peter dbfb4eb8d9 Temp 2019-08-26 04:25:02 +04:00
Peter b6316ab12c Refactor PeerInfoUI and related modules 2019-08-15 14:12:19 +03:00