Commit Graph
3870 Commits
Author SHA1 Message Date
IsaacandClaude Opus 4.7 b2ba4b5878 Postbox -> TelegramEngine wave 7: last TelegramEngine.* facade leaks
Closes the seven remaining raw-Postbox leaks in TelegramEngine public
facades surfaced by a post-wave-6 scouting pass (all non-permanently-
blocked candidates).

Facades migrated in place (6 rewrites + 1 deletion; all _internal_*
implementations unchanged per the "internal Postbox-facing stays raw"
rule):

  Messages:
    downloadMessage                          Signal<Message?>           -> Signal<EngineMessage?>
    topPeerActiveLiveLocationMessages        Signal<(Peer?, [Message])> -> Signal<(EnginePeer?, [EngineMessage])>
    getSynchronizeAutosaveItemOperations     deleted (dead facade; sole caller uses _internal_ directly)

  Peers:
    updatedRemotePeer                        Signal<Peer>  -> Signal<EnginePeer>
                                             (PeerReference param kept; no EnginePeer.Reference alias today)

  Resources:
    renderStorageUsageStatsMessages          [EngineMessage.Id: Message]  -> [EngineMessage.Id: EngineMessage]
    clearStorage(peerId: ...)                [Message]                     -> [EngineMessage]
    clearStorage(peerIds: ...)               [Message]                     -> [EngineMessage]
    clearStorage(messages:)                  [Message]                     -> [EngineMessage]
                                             (no external callers; migrated for overload-set consistency)

Consumer call-site updates (5 files):
  - ChatListSearchListPaneNode       drop redundant .flatMap(EngineMessage.init) wrap
  - LocationViewControllerNode       drop redundant .map(EngineMessage.init) wrap
  - LiveLocationSummaryManager       drop redundant EnginePeer(...) / EngineMessage(...) ctors
  - StorageUsageScreen               bridge [Message] <-> [EngineMessage] at the 4 facade-call points
                                     (internal [MessageId: Message] / [Message] storage kept;
                                      full-consumer-module migration is out of scope)

Discovery: grep of TelegramEngine/*/TelegramEngine*.swift public signatures
for `: Postbox|: Account|: MediaBox|: MediaResource|: Peer\b|: Message\b|
-> Signal<.*(Peer|Message)` turned up these seven candidates and no others.
After this wave, the full TelegramEngine.* facade surface is engine-typed
modulo the four permanently-blocked TelegramMediaResource-conforming
classes recorded in CLAUDE.md (ICloudFileResource, InstantPageExternal-
MediaResource, VideoLibraryMediaResource, YoutubeEmbedStoryboardMedia-
Resource).

No modules became Postbox-free in this wave. Plan: docs/superpowers/
plans/2026-04-20-postbox-to-telegramengine-wave-7.md.

Full project build verified green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 00:25:28 +02:00
Isaac 8edaa79eda Merge commit '23c4d9474868a4a694a44fd11f84f914c13fb259' 2026-04-19 23:54:22 +02:00
IsaacandClaude Opus 4.7 c99adbbe0b Postbox -> TelegramEngine wave 5: uploadSecureIdFile + SecureId context
Migrates uploadSecureIdFile's public signature from (context:,
postbox: Postbox, network: Network, resource: MediaResource) to
(context:, engine: TelegramEngine, resource: EngineMediaResource).
SecureIdVerificationDocumentsContext refactored to hold
engine: TelegramEngine instead of raw postbox + network, drops
import Postbox (tally +1). The one instantiation site in
SecureIdDocumentFormControllerNode updates to pass
engine: self.context.engine.

Completes the last explicitly-named future-wave candidate from
CLAUDE.md.

Bundled: spec + plan + C1 atomic migration + CLAUDE.md outcome.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:59 +02:00
IsaacandClaude Opus 4.7 b989b160c0 Postbox -> TelegramEngine wave 4: TelegramEngine.Stickers.uploadSticker
Migrates uploadSticker's public surface from (peer: Peer,
resource: MediaResource, thumbnail: MediaResource?, ...) to
(peer: EnginePeer, resource: EngineMediaResource,
thumbnail: EngineMediaResource?, ...), and UploadStickerStatus.complete
payload from CloudDocumentMediaResource to EngineMediaResource. Both
external call sites plus the cascading destructure and .standalone
sites inside MediaEditorScreen migrated atomically.

Bundled: spec + fix + plan + C1 atomic facade migration + CLAUDE.md
outcome + enum-payload inventory lesson added to wave-selection
guidance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:48 +02:00
IsaacandClaude Opus 4.7 4ae15b42a7 Postbox -> TelegramEngine wave 3: MediaBox fetch/status/data facades + SaveToCameraRoll
Adds three thin forwarding methods on TelegramEngine.Resources
(fetch, status, data) over MediaBox, then migrates SaveToCameraRoll's
three public functions to use them, drops import Postbox from the
module (source + Bazel dep), and updates all 23 call sites across 14
caller files atomically.

Bundled: spec + fix + plan + C1 facades + C2 SaveToCameraRoll rewrite
+ BUILD dep drop + CLAUDE.md outcome.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:34 +02:00
IsaacandClaude Opus 4.7 d01bbc6529 TelegramCore: edit/delete AI text styles + AI webpage attribute
Adds TelegramEngine.Messages.editAITextStyle and deleteAITextStyle
facades and decodes webPageAttributeAiComposeTone into a new
TelegramMediaWebpageAITextStyleAttribute. Makes CloudStyle.prompt
optional and requires emojiFileId on create.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 23:45:18 +02:00
Ilya Laktyushin b138b9f549 Stickers & emoji search pagination 2026-04-19 18:32:40 +02:00
Ilya Laktyushin 1fa0c7991c Various fixes 2026-04-17 11:06:56 +02:00
Isaac bbfd1ddca0 Merge commit '532a3ae3e1e6220268535100f7aeb7b2eb2918d0' 2026-04-17 09:09:55 +02:00
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
IsaacandClaude Opus 4.6 ad85ef6517 Postbox → TelegramEngine refactor: wave 1
Drop direct `import Postbox` from four leaf consumer submodules, routing
data access through TelegramEngine/TelegramCore. Behavior-preserving.

Consumers migrated:
- ChatInterfaceState
- ChatSendMessageActionUI
- ContactListUI
- DrawingUI

TelegramCore additions (typealiases + one EngineData item):
- EngineMemoryBuffer, EnginePostboxDecoder, EnginePostboxEncoder,
  EngineAdaptedPostboxDecoder (narrow utility aliases for coding support)
- EngineData.Item.Configuration.ContactsSettings

Six planned modules were abandoned in wave 1 with reasons recorded in
the plan: ActionSheetPeerItem, ChatListSearchRecentPeersNode,
DirectMediaImageCache, FetchManagerImpl, GalleryData, ICloudResources.
Each either has a public API that leaks `Postbox`/`Account`/`MediaBox`
(banned umbrella-type aliases) or cascades into out-of-wave modules.

CLAUDE.md now records the wave rules, typealias cheat sheet, and the
wave-selection guidance learned from this pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 23:16:45 +02:00
Ilya Laktyushin 532a3ae3e1 Various fixes 2026-04-16 21:45:26 +02:00
Isaac bf21bca206 Merge commit '31e3a7dc79a91d78d9dda66945f81c9fc3d62b8e'
# Conflicts:
#	submodules/TelegramCore/Sources/PendingMessages/PendingMessageUploadedContent.swift
#	submodules/TelegramCore/Sources/TelegramEngine/Messages/Polls.swift
#	submodules/TelegramCore/Sources/TelegramEngine/Messages/Translate.swift
2026-04-16 17:52:38 +02:00
Ilya Laktyushin 0df319742a Update API 2026-04-16 01:18:22 +02:00
Isaac 0095bfad39 Temp 2026-04-15 13:18:46 +02:00
Isaac a4e9b0468e Merge commit '314f02d36da460c0de5f55fe06582084944157f2' 2026-04-14 15:34:04 +02:00
Isaac 976c2de599 Temp 2026-04-14 15:33:19 +02:00
Ilya Laktyushin 64aa306cf9 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-04-14 03:34:28 +02:00
Ilya Laktyushin 22df2dbdb9 Various fixes 2026-04-14 03:33:34 +02:00
Isaac d575824ab4 Various improvements 2026-04-10 14:30:23 +02:00
Isaac 34477605b1 Various improvements 2026-03-31 20:24:24 +08:00
Isaac 001a5ed5b1 Merge commit 'b3d4c97da45b8932dbbfdde498138bf6fb152f27' 2026-03-30 19:59:16 +08:00
Isaac c73bceb797 Cleanup 2026-03-30 19:59:03 +08:00
Ilya Laktyushin 21adc7d061 Various improvements 2026-03-30 02:55:35 +02:00
Ilya Laktyushin f3c18e1436 Various improvements 2026-03-29 22:18:19 +02:00
Ilya Laktyushin 8d7b84caac Various fixes 2026-03-29 18:49:14 +02:00
Ilya Laktyushin f160fb99d9 Various improvements 2026-03-29 16:23:09 +02:00
Ilya Laktyushin 53d5425341 Various fixes 2026-03-28 18:27:01 +01:00
Ilya Laktyushin 784b43934a Update text styles data 2026-03-27 22:59:36 +01:00
Isaac 0b878e4d24 Various improvements 2026-03-28 00:52:16 +08:00
Mikhail Filimonov 3c4af77ad2 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-03-27 16:18:49 +01:00
Mikhail Filimonov b5973fed13 canManageBots flag 2026-03-27 16:18:42 +01:00
Isaac 51d1b693d1 Updates 2026-03-27 20:16:52 +08:00
Isaac 8dd7b4c8e7 Temp 2026-03-27 19:30:03 +08:00
Isaac d11a967936 Merge commit 'fd68aed7665cdd25242a79a061ac61c42547b834' 2026-03-27 19:24:49 +08:00
Isaac 911ebd07ab Update 2026-03-27 19:23:09 +08:00
Isaac 2907ddbe46 Unseen polls 2026-03-27 18:30:01 +08:00
Ilya Laktyushin fd68aed766 Auth improvements 2026-03-27 11:24:08 +01:00
Ilya Laktyushin ed55943a44 Various improvements 2026-03-27 01:13:38 +01:00
Ilya Laktyushin e3eac999c4 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-03-26 09:26:21 +01:00
Ilya Laktyushin 6b6ba070c7 Update API 2026-03-26 09:26:15 +01:00
Isaac c3181ed97e Adjust spacing 2026-03-26 00:41:21 +08:00
Ilya Laktyushin 583e794a53 Merge branches 'master' and 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-03-24 17:21:52 +01:00
Ilya Laktyushin 25762d1133 Various fixes 2026-03-24 17:21:46 +01:00
Isaac 3920eb1507 Merge commit '010945d3718cca34348409d0410b71ebe9d39347' 2026-03-24 16:48:05 +08:00
Isaac a0a2f9f6bf Various improvements 2026-03-24 16:47:36 +08:00
Mikhail Filimonov 010945d371 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-03-24 09:26:24 +01:00
Mikhail Filimonov 84bc40e1f8 polls 2026-03-24 09:26:16 +01:00
Isaac 9c0e6f6151 Merge commit 'e11c9899e63f71ebd75986b792eb94a1b7754574' 2026-03-24 01:39:57 +08:00
Isaac f437e0bd04 Text editor 2026-03-24 01:39:53 +08:00