18 Commits
Author SHA1 Message Date
IsaacandClaude Opus 4.6 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
Isaac 34477605b1 Various improvements 2026-03-31 20:24:24 +08:00
Mikhail Filimonov ffa620b62b - add contact improments. 2025-10-20 21:04:05 +03:00
Ilya Laktyushin 0915a42e64 Various improvements 2025-10-16 05:30:06 +04:00
Ilya Laktyushin cb523192d5 Various improvements 2025-09-17 20:58:42 +04:00
Isaac 46dad2eddc WIP 2025-07-25 15:20:36 +02:00
Ilya Laktyushin dce651616e Update API [skip ci] 2024-12-18 21:40:23 +04:00
Isaac fa0929ef95 - reaction count limit API
- my profile stories improvements
- recommended channels
2024-04-05 22:51:46 +04:00
Ilya Laktyushin 669151da80 Various improvements 2024-01-26 01:53:43 +04:00
Ali 77a5857a25 Sharing refactoring 2023-08-15 23:57:04 +04:00
Ilya Laktyushin 1b723cd2a7 Avatar upload improvements 2023-01-28 04:42:49 +04:00
Ilya Laktyushin 07070d1212 Update API [skip ci] 2022-12-07 19:20:45 +04:00
Ilya Laktyushin 1103706315 Update API 2022-12-05 17:05:40 +04:00
Ali ff22c7e981 [WIP] General UI improvements 2022-09-16 22:59:16 +04:00
Ali 47fb45e08f Refactoring 2022-05-29 03:00:17 +04:00
Ali 49279a33f0 Refactoring 2021-09-23 19:57:25 +03:00
Ali 3eead87254 Refactoring 2021-09-23 18:59:10 +03:00
Ali 9134bae908 Refactoring 2021-07-07 01:59:12 +04:00