Commit Graph
59 Commits
Author SHA1 Message Date
IsaacIsaacClaude 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
IsaacIsaacClaude Opus 4.5
1f4b520b1b Refactor constructor use sites for types 440-459 to struct pattern
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 23:29:12 +08:00
IsaacIsaacClaude Opus 4.5
b5dc0b2fd9 Refactor constructor use sites for types 400-419 to struct pattern
Refactored Api constructors in authorization and channel-related code:
- authorization, authorizationSignUpRequired, sentCode, sentCodeSuccess,
  sentCodePaymentRequired, sentCodeTypeFirebaseSms, and related types
- channelParticipant, channelParticipants, sendAsPeers, adminLogResults
- chatlistInvite, chatlistInviteAlready, chatlistUpdates, exportedChatlistInvite
- popularAppBots, sponsoredMessageReportResultChooseOption, and others

Fixed variable shadowing issues where 'user' was extracted and then
immediately shadowed by TelegramUser initialization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 23:15:21 +08:00
IsaacIsaacClaude Opus 4.5
c6b0ef5da3 Refactor constructor use sites for types 220-239 to struct pattern
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:08:10 +08:00
IsaacandIsaac 7013cd9fee Merge branch 'master' into api-refactoring
# Conflicts:
#	submodules/TelegramApi/Sources/Api0.swift
#	submodules/TelegramApi/Sources/Api25.swift
#	submodules/TelegramApi/Sources/Api26.swift
#	submodules/TelegramApi/Sources/Api27.swift
#	submodules/TelegramApi/Sources/Api28.swift
#	submodules/TelegramApi/Sources/Api29.swift
#	submodules/TelegramApi/Sources/Api30.swift
#	submodules/TelegramApi/Sources/Api31.swift
#	submodules/TelegramApi/Sources/Api32.swift
#	submodules/TelegramApi/Sources/Api33.swift
#	submodules/TelegramApi/Sources/Api34.swift
#	submodules/TelegramApi/Sources/Api35.swift
#	submodules/TelegramApi/Sources/Api36.swift
#	submodules/TelegramApi/Sources/Api37.swift
#	submodules/TelegramApi/Sources/Api38.swift
#	submodules/TelegramApi/Sources/Api39.swift
2026-01-17 04:12:49 +08:00
Mikhail Filimonov db93244583 update api (rarities, crafted) 2026-01-16 16:20:08 +04:00
IsaacIsaacClaude Opus 4.5
a78b2c0db2 Refactor Api types 70-89 to use struct-wrapped constructors
Types refactored:
- 70-79: contactStatus, dataJSON, dcOption, defaultHistoryTTL, dialog,
  dialogFolder, dialogFilter, dialogFilterChatlist, dialogFilterSuggested,
  dialogPeer, dialogPeerFolder, disallowedGiftsSettings, document, documentEmpty
- 80-89: documentAttribute* (Audio, CustomEmoji, Filename, ImageSize, Sticker, Video),
  draftMessage, draftMessageEmpty, emailVerification* (Apple, Code, Google),
  emailVerifyPurposeLoginSetup, emoji* (Group, GroupGreeting, GroupPremium,
  Keyword, KeywordDeleted, KeywordsDifference, Language, List, Status,
  StatusCollectible), inputEmojiStatusCollectible

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 02:12:20 +08:00
IsaacIsaacClaude Opus 4.5
df3b1cddcf Refactor Api types 60-64 to use struct-wrapped constructors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 01:29:09 +08:00
Ilya Laktyushin a0e96582dd Update API [skip ci] 2025-09-19 12:20:21 +04:00
Ilya Laktyushin 4b8d87b05f Merge commit '202274073fa5df7a5fbaa4621e3da054a1a0284b' into call-messages 2025-09-17 22:05:40 +04:00
Ilya Laktyushin cb523192d5 Various improvements 2025-09-17 20:58:42 +04:00
IsaacandIsaac 04765e0c36 Update 2025-09-17 11:18:26 +04:00
Ilya Laktyushin fd0c7918ff Update API 2025-04-11 12:11:48 +04:00
Ilya Laktyushin 2ecbaf4507 Various improvements 2025-03-10 15:32:15 +04:00
Ilya Laktyushin b6f8cce7ea Update API [skip ci] 2025-01-10 15:22:27 +04:00
Ilya Laktyushin ffbc7921cf Web app improvements 2024-06-28 23:41:21 +04:00
IsaacandIsaac 95ffacf97c Fix firebase 2024-05-15 19:32:06 +04:00
IsaacandIsaac 8736981248 Message effects improvements 2024-05-13 20:14:15 +04:00
Ilya Laktyushin 06d5377bd4 Update API 2024-04-04 02:41:40 +04:00
IsaacandIsaac ef12bf9ce6 Chat links and other features 2024-03-23 00:00:08 +04:00
Ilya Laktyushin 8279db283c Update API [skip ci] 2024-03-18 23:53:29 +04:00
IsaacandIsaac fc8857d916 Update API 2024-03-18 19:23:58 +04:00
IsaacandIsaac 7966993955 Business fixes 2024-03-05 15:32:59 +04:00
IsaacandIsaac aa4ca00cb0 [WIP] Business 2024-02-27 16:20:37 +04:00
IsaacandIsaac 50339b3c4c [WIP] Business 2024-02-23 23:12:28 +04:00
IsaacandIsaac 6ed9cef40a [WIP] Quick replies 2024-02-23 15:26:33 +04:00
IsaacandIsaac f259829c8a [WIP] Business 2024-02-20 14:45:25 +04:00
IsaacandIsaac dd57e99cca Peer colors 2023-11-23 19:29:49 +04:00
IsaacandIsaac f47a710fb9 Fix colors 2023-11-23 18:30:02 +04:00
IsaacandIsaac f5b039e556 Update colors API 2023-11-22 19:02:11 +04:00
IsaacandIsaac 497c7fab1f Update API 2023-11-22 16:42:29 +04:00
IsaacandIsaac 66b3d8b874 [WIP] Colored profiles 2023-11-22 01:05:47 +04:00
AliandAli bc576aab86 Fix push in change number flow 2023-11-14 16:41:10 +04:00
Ilya Laktyushin 4f183fa7fe Name colors improvements 2023-10-17 01:41:53 +04:00
Ilya Laktyushin 137c3d9101 Update API 2023-10-16 13:20:46 +04:00
AliandAli f3ee06dd32 Stories 2023-07-07 02:03:11 +04:00
AliandAli f2d01c4f8a Push token invalidation 2023-02-10 22:17:28 +04:00
Ilya Laktyushin 29c7eb0cc0 Translation improvements 2023-01-23 21:10:27 +04:00
Ilya Laktyushin 125ae0f124 Update API [skip ci] 2023-01-17 20:03:49 +04:00
AliandAli 52877b552c Support firebase auth 2023-01-13 01:36:25 +04:00
AliandAli 58f6657c6e API updates, token login support, initial data usage screen implementation 2023-01-07 00:36:12 +04:00
Ilya Laktyushin 47ffcd2e4d Update API [skip ci] 2022-12-13 17:42:32 +04:00
AliandAli 7020c5ed05 Status and reaction improvements 2022-09-05 03:57:37 +04:00
AliandAli fe3715bd90 Update API 2022-09-02 01:07:59 +04:00
AliandAli ffe00ac2e1 Reaction improvements 2022-08-19 22:51:12 +03:00
AliandAli feb899920c [WIP ]Emoji statuses 2022-08-09 22:58:03 +04:00
AliandAli 04ea87c1e3 [WIP] Emoji statuses 2022-08-05 23:16:30 +04:00
Ilya Laktyushin a22cf29e19 Various fixes 2022-06-21 15:57:37 +05:00
AliandAli 3e60c417bf Update API [skip ci] 2021-11-23 17:07:59 +04:00
AliandAli 1141e09c1b Refactoring 2021-09-07 13:09:06 +04:00