50 Commits

Author SHA1 Message Date
Ilya Laktyushin f41630083a Various improvements 2026-04-24 03:16:14 +02:00
isaac 4879d89a92 Postbox -> TelegramEngine wave 22: storeResourceData facade + consumer sweep
Same shape as wave 21. Adds TelegramEngine.Resources.storeResourceData(id:, data:, synchronous:)
and sweeps 46 context.account.postbox.mediaBox.storeResourceData sites across 17 files.

The range-store overload and accountManager.mediaBox sites are explicitly out of scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 03:51:11 +04:00
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
Ilya Laktyushin 28d4e1e171 Various improvements 2025-12-16 20:05:44 +04:00
Isaac adbc7bad61 Various improvements 2025-07-01 14:57:33 +02:00
Ilya Laktyushin c73f24f5f2 Various improvements 2025-01-20 05:46:17 +04:00
Ilya Laktyushin 1ae20bd685 Various improvements 2024-06-15 18:41:19 +04:00
Ilya Laktyushin 097eacdc34 Various improvements 2024-05-25 02:29:19 +04:00
Ali 77a5857a25 Sharing refactoring 2023-08-15 23:57:04 +04:00
Ilya Laktyushin bf94ea75e9 Various fixes 2023-02-06 00:55:17 +04:00
Ilya Laktyushin 72fce11e2d Various fixes 2023-01-27 00:57:19 +04:00
Ilya Laktyushin ad0fe38ba7 Various improvements 2023-01-23 15:48:57 +04:00
Ilya Laktyushin 58c532b51e Various improvements 2023-01-21 15:56:57 +04:00
Ilya Laktyushin 587d700978 Various fixes 2023-01-19 17:00:41 +04:00
Ilya Laktyushin 71f367027d Various fixes 2023-01-18 19:44:24 +04:00
Ilya Laktyushin ce08d17d29 Fix avatar setup crash 2023-01-14 13:54:15 +04:00
Ilya Laktyushin 930e237bf1 Bot peer request support
Launch screen icon
2023-01-13 22:38:04 +04:00
Ilya Laktyushin 9937826307 Various fixes 2022-12-23 10:11:08 +04:00
Ilya Laktyushin fe904af993 Avatar fixes 2022-12-17 20:24:26 +04:00
Ilya Laktyushin 5788f4a1ac Custom contact photos [skip ci] 2022-12-06 16:03:53 +04:00
Ilya Laktyushin 1103706315 Update API 2022-12-05 17:05:40 +04:00
Ilya Laktyushin ab9bb767c2 Various fixes 2022-11-27 16:17:22 +04:00
Ali a92f3fe738 Fix build 2022-11-01 18:07:52 +04:00
Ali 3edd84cf95 Refactoring 2022-05-27 22:33:40 +04:00
Ali 51d8d56ec7 Refactoring & update Xcode 2021-09-26 01:05:20 +03:00
Ali 6e5c503338 Refactoring 2021-09-20 14:51:46 +03:00
Ali d6446a284b Merge branch 'master' into experimental-2 2021-08-05 01:44:20 +02:00
Ali 31bc746984 Fix more warnings 2021-08-05 01:42:59 +02:00
Ali 7c8ad70014 Merge branch 'master' into experimental-2 2021-07-21 22:04:58 +02:00
Ali 1a04fb4408 Refactor SyncCore back into TelegramCore 2021-07-21 21:43:20 +02:00
Ali 617bcc314e Merge branch 'master' into experimental-2
# Conflicts:
#	submodules/ChatListUI/Sources/ChatContextMenus.swift
#	submodules/TelegramCore/Sources/TelegramEngine/Calls/GroupCalls.swift
2021-07-18 01:10:29 +02:00
Ali d4572a9248 Refactoring 2021-07-18 01:03:43 +02:00
Ali ee8ec6ed30 Merge branch 'master' into features/64-bit 2021-07-07 02:08:56 +04:00
Ali 9134bae908 Refactoring 2021-07-07 01:59:12 +04:00
Ali a23971c0ef Initial 64-bit id support 2021-06-28 20:02:50 +04:00
Ali 60d959bff8 Refactoring 2021-04-18 03:10:18 +04:00
Ali d1160beadf Resource API refactoring 2021-03-29 21:20:08 +04:00
Ali 4dae31e340 Initial peer id refactoring 2021-03-24 19:35:52 +04:00
Ilya Laktyushin 1df19d94a6 Various fixes 2021-02-26 20:22:09 +04:00
Ali 9b90e94ab8 Comment updates 2020-09-24 23:23:28 +04:00
Ali e1432e4171 Implement progressive JPEG for photos 2020-07-28 17:39:34 +04:00
Ilya Laktyushin 4ac6678182 Video avatar fixes 2020-07-16 18:23:50 +03:00
Ilya Laktyushin 2abe662fed Video avatar fixes 2020-07-16 16:03:12 +03:00
Ilya Laktyushin 99f166b698 Video avatar fixes 2020-07-11 01:16:07 +03:00
Ilya Laktyushin ab41dbe22a Video avatar fixes 2020-07-10 15:41:51 +03:00
Ilya Laktyushin 688d692993 Video avatar fixes 2020-07-10 13:02:28 +03:00
Ilya Laktyushin 37895d675b Update settings screen 2020-07-07 02:48:35 +03:00
Ilya Laktyushin cccb11a5d6 Video avatar fixes 2020-07-01 04:43:39 +03:00
Ilya Laktyushin 00d6d4b484 Video editor fixes 2020-05-28 07:06:33 +03:00
Ali f57d6b6168 Temp 2020-02-20 18:08:36 +04:00