Commit graph

86 commits

Author SHA1 Message Date
isaac
69bfc65da7 Postbox refactor waves 138–276: 168-commit squash
Consolidates 137 wave commits + 31 supporting commits (CLAUDE.md bump,
typealias additions, AnyObject→EngineMedia restoration) into one squashed
commit. Migrates dozens of consumer-side public APIs, struct fields,
protocol methods, and enum payloads from Postbox protocols/structs to
TelegramEngine engine wrappers and typealiases. Drops `import Postbox`
from many files. Adds new TelegramCore typealiases and one
TelegramEngineUnauthorized facade.

Notable changes by category:

**TelegramCore typealias additions** (rule 2 — narrow utility typealiases):
- EngineChatListIndex, EngineTempBoxFile, EngineItemCollectionItemIndex,
  EngineItemCollectionViewEntryIndex, EngineValueBoxEncryptionParameters,
  EngineMessageAndThreadId, EnginePeerStoryStats, EngineMessageHistoryAnchorIndex,
  EngineChatListTotalUnreadStateCategory, EngineChatListTotalUnreadStateStats,
  EnginePeerSummaryCounterTags, EngineChatListTotalUnreadState,
  EngineItemCacheEntryId, EngineHashFunctions,
  EngineCachedMediaResourceRepresentationResult,
  EngineMediaResourceDataFetchResult, EngineMediaResourceDataFetchError,
  EngineMediaResourceStatus, EngineCachedPeerData

**TelegramCore engine extensions/forwarders**:
- EngineMessage.engineMedia, EngineMessage.enginePeers,
  EngineMessage.adAttribute, EngineMessage.effectivelyIncoming
- engineFileSize forwarder
- TelegramEngine.Resources.clearCachedMediaResources(mediaResourceIds: Set<EngineMediaResource.Id>)
- TelegramEngine.Resources.fetchStatus(id:resourceSize:)
- TelegramEngineUnauthorized.UnauthorizedResources facade with storeResourceData

**Public API/struct migrations to engine types**:
- ChatAvailableMessageActions.banAuthor/banAuthors → EnginePeer?/[EnginePeer]
- WebSessionsContextState.peers → [EnginePeer.Id: EnginePeer]
- CacheUsageStats.peers → [EnginePeer.Id: EnginePeer]
- PeerCommand.peer → EnginePeer
- PeerInfoControllerMode.calls(messages:) → [EngineMessage]
- CallControllerNodeProtocol.updatePeer → EnginePeer params
- ChatHistoryListNode.messageInCurrentHistoryView (and 4 variants) → EngineMessage?
- ChatHistorySearchContainerNode.messageForGallery → EngineMessage?
- PeerInfoPaneNode.findLoadedMessage / ensureMessageIsVisible /
  transitionNodeForGallery → engine-typed
- GalleryHiddenMediaTarget.getTransitionInfo /
  GalleryHiddenMediaManager.findTarget → engine-typed
- ChatPanelInterfaceInteraction.presentReactionDeletionOptions /
  presentBan*MessageOptions → EnginePeer
- DrawingMessageRenderer.messages → [EngineMessage]
- ChatVideoGalleryItemScrubberView.setFetchStatusSignal →
  EngineMediaResource.FetchStatus
- ChannelDiscussionGroupActionSheetItem.peer, VoiceChatPeerEntry.peer,
  VoiceChatFullscreenParticipantItem.peer, MediaStreamComponent.chatPeer,
  MediaStreamVideoComponent.callPeer, ChatMessageContactBubbleContentNode.contactPeer,
  ChatMessageForwardInfoNode.peer, ChatMessageCommentFooterContentNode.replyPeers,
  ChatReportPeerTitlePanelNode.peer, ChatMessageActionUrlAuthController.bot,
  PeerMediaCollectionInterfaceState.peer, ChatMessageCallBubbleContentNode.peopleAvatars,
  ChatLoadingNode.renderedPeer (→ EngineRenderedPeer) — all to engine types

**Wave-71-shadow stored-field migrations** (Postbox Peer/Message → Engine wrapper):
- LegacyCallControllerNode.peer
- CallStatusBarNode.currentPeer

**Dead-code / dead-field removals**:
- CallController.peer, CallControllerNodeV2.account,
  ContactMultiselectionController PeerNameIndex fields,
  preparedChatListNodeViewTransition account: Account param,
  FetchResource.swift entirely (unused function)

**Module-level Postbox import drops**: 30+ files including TelegramRootController,
EditStories, GiftViewScreen, AnimatedStickerUtils, FetchPhotoLibraryImageResource,
PeerInfoGiftsPaneNode, PeerInfoPaneContainerNode, PresentAddMembers,
PeerInfoProfileItems, ChatControllerAdminBanUsers, PresentationData typealiases,
DefaultDayPresentationTheme, ChatListViewTransition, GalleryHiddenMediaManager,
RecentSessionsController, GifContext, AuthorizationSequenceController,
PeerInfoHeaderEditingContentNode, PeerInfoHeaderNode,
PeerAllowedReactionListController, CallControllerNodeV2, and 6 PeerInfo pane files.

**AnyObject restoration**: rule 8 added (never substitute Postbox protocols
with Any/AnyObject) — undid previous AnyObject substitutions in waves 141/143
back to EngineMedia.

Doc maintenance: CLAUDE.md updated to reflect new typealiases and forwarders.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 00:44:27 +02:00
isaac
d1aa0db537 Postbox -> TelegramEngine waves 46-93 (squashed)
Squash of 63 commits spanning waves 46-93 (plus interspersed docs commits)
of the gradual Postbox->TelegramEngine consumer-side migration.

Scope: 139 files changed, 2123 insertions(+), 452 deletions(-).

## Themes by wave-block

**Waves 46-58 — Peer field migrations + facade additions**
Foundational EnginePeer convenience init additions (PeerReference, RenderedPeer,
SelectivePrivacyPeer). Multiple `peer: Peer` field migrations across PeerInfo,
ChatList, and SettingsUI components.

**Waves 59-73 — peer field cascade + EnginePeer wrap drops**
Series of single- to two-file peer-field migrations; consumer-side wrap
removal (`EnginePeer(peer)` -> direct EnginePeer use); `as? TelegramUser`
cast conversion to `case let .user(...)` enum match. Wave 64: RenderedPeer
convenience init. Wave 68: SelectivePrivacyPeer convenience init.

**Waves 74-83 — controller-Node bridge cleanup + small migrations**
Wave-71 shadow-pattern cleanup at controller->Node bridges. Migrations of
ChatRecentActionsController.peer (74), PeerInfoMember (75), MentionChatInputPanelItem
(76), PassportUI SecureIdAuthController (77), AccountWithInfo + ShareController
(78), peerInputActivitiesPromise (79), InactiveChannel (80), BlockedPeers (81),
openHashtag resolveSignal (82), NotificationExceptionsList (83).

**Waves 84-90 — TelegramEngine.Resources facade migrations**
Per-method Shape-A/B sweeps converting `<ctx>.account.postbox.mediaBox.X(...)`
to `<ctx>.engine.resources.X(...)`. Wave 90 was a single-commit big sweep:
40 fetchedMediaResource sites in 25 files migrated to engine.resources.fetch
facade in one atomic pass with first-pass-clean build.

Methods covered: storeResourceData, completedResourcePath, cancelInteractiveResourceFetch,
resourceRangesStatus, resourceStatus, fetch (fetchedMediaResource).

**Waves 91-92 — additional type migrations**
Wave 91: ItemListWebsiteItem.peer + RecentSessionsController enum-case payload
+ openWebSession callback Peer? -> EnginePeer?.
Wave 92: ChatListController StateHolder.EntryContext status type
MediaResourceStatus -> EngineMediaResource.FetchStatus.

**Wave 93 — speculative `import Postbox` drop sweep**
Drop import from 7 wave-touched files where it became unused; restore in 5
files where bare PeerId/Message/MediaId/StoryId references escaped the
pre-flight regex. Includes one MediaId(...) -> EngineMedia.Id(...) swap in
InAppPurchaseManager to unlock its import drop.

## Build state

Final state at squash: clean Telegram/Telegram build at debug_sim_arm64.

## Persistent-state notes

- Pre-existing WIP unchanged across the squashed range:
  - build-system/bazel-rules/sourcekit-bazel-bsp submodule marker
  - Untracked: build-system/tulsi/, submodules/TgVoip/, third-party/libx264/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 20:48:15 +04:00
isaac
493f3103b3 Postbox -> TelegramEngine waves 37-43 + wave 44 design/plan (squashed)
Squashes 20 commits — the implementation and outcome commits of
waves 37 through 43 plus wave 44's spec and implementation-plan
docs — into a single commit. Per-wave lessons remain recorded in
docs/superpowers/postbox-refactor-log.md. The unrelated "Add swift
svg" commit is preserved separately outside this squash.

Wave 37 — peerTokenTitle: peer Peer → EnginePeer (1 file)
Wave 38 — canSendMessagesToPeer: peer Peer → EnginePeer (12 files)
Wave 39 — AccountContext.makePeerInfoController: peer Peer → EnginePeer (52 files)
Wave 40 — makeChatQrCodeScreen + makeChatRecentActionsController bundle (8 files)
Wave 41 — RenderedChannelParticipant.peer: Peer → EnginePeer (28 files)
Wave 42 — PeerInfoScreenData.peer: Peer? → EnginePeer? (17 files)
Wave 43 — PeerInfoScreen 6 helpers: peer Peer? → EnginePeer? (12 files)
Wave 44 — RenderedChannelParticipant.peers design doc + implementation plan
         (impl and outcome land in subsequent commits, not part of squash)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 23:19:43 +04:00
isaac
8408e0ae19 Postbox -> TelegramEngine waves 27-36
Consumer-sweep, facade-addition, and Peer→EnginePeer migrations:

- Wave 27: preferencesView consumer sweep
- Wave 28: resourceData consumer sweep
- Wave 29: resourceStatus consumer sweep
- Wave 30: _asStatus() bridge cleanup
- Wave 31: unused-import sweep re-run
- Wave 32: resourceStatus residue sweep
- Wave 33: loadedPeerWithId consumer sweep
- Wave 34: FoundPeer.peer Peer -> EnginePeer
- Wave 35: SendAsPeer.peer Peer -> EnginePeer
- Wave 36: ContactListPeer.peer Peer -> EnginePeer

Also includes per-wave specs, implementation plans, outcome logs, and
a CLAUDE.md wave-counter update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:24:13 +04:00
Ilya Laktyushin
5efa8f63c0 Various fixes 2026-02-27 21:41:43 +04:00
Ilya Laktyushin
e12e096919 Various fixes 2026-02-27 00:53:51 +04:00
Ilya Laktyushin
142d59cf8f Various improvements 2026-01-27 22:24:31 +04:00
Ilya Laktyushin
0d12dd29ad Various improvements 2026-01-25 22:17:49 +04:00
Ilya Laktyushin
2cb5122bb3 Various improvements 2025-10-20 22:57:29 +04:00
Isaac
d5a6cb86d2 Cleanup 2025-06-18 11:57:34 +04:00
Ilya Laktyushin
d776dc0597 Add gift auto save privacy 2024-11-14 05:20:19 +04:00
Ilya Laktyushin
bd1cbdae5a Various improvements 2024-10-29 13:46:22 +04:00
Ilya Laktyushin
5d2377bcb7 Various improvements 2024-06-15 20:34:07 +04:00
Ilya Laktyushin
cf49acb4aa Various fixes 2024-04-29 17:45:32 +04:00
Ilya Laktyushin
562d4e6598 Update API 2024-03-19 01:53:18 +04:00
Ilya Laktyushin
16903cdffd Business intro screen 2024-02-16 15:29:55 -04:00
Ilya Laktyushin
2bb75e1356 Add hide read time setting 2024-01-04 20:00:45 +04:00
Isaac
0e75f18f14 [WIP] Saved messages 2023-12-25 22:58:09 +04:00
Ilya Laktyushin
8f38831261 Various improvements 2023-12-19 14:15:09 +04:00
Ilya Laktyushin
9cd6344b53 Various improvements 2023-11-25 14:10:36 +04:00
Ilya Laktyushin
2179c8318d Opening progress for giveaway and gift link messages 2023-11-02 20:29:24 +04:00
Ilya Laktyushin
b70586eb28 Story location picking 2023-07-30 15:01:25 +02:00
Ali
875ad20c6d Localization 2023-07-16 18:13:43 +04:00
Ilya Laktyushin
dc0d4d25bf Various improvements 2023-07-07 07:02:54 +02:00
Ilya Laktyushin
d15c48ff07 Camera and media editor improvements 2023-05-10 17:10:27 +04:00
Ali
95947fdb99 Refactoring [skip ci] 2023-04-20 18:43:29 +04:00
Ilya Laktyushin
4ac9d1cb57 Various improvements 2023-03-28 20:30:04 +04:00
Ilya Laktyushin
839cb36a5b Various fixes 2023-03-02 19:16:37 +04:00
Ali
a11de52d56 Low power improvements 2023-02-28 22:20:44 +04:00
Ilya Laktyushin
4c500ce3b2 Various fixes 2023-02-23 23:49:04 +04:00
Ali
41060f0da0 Modernized save to gallery 2023-01-13 21:14:45 +04:00
Ilya Laktyushin
37e752c78f Various forum improvements 2022-11-15 22:29:09 +04:00
Ilya Laktyushin
1c0af395db Various improvements 2022-11-08 15:11:37 +04:00
Ali
6847dbb4c3 [WIP] Topics 2022-10-18 16:56:27 +04:00
Ilya Laktyushin
9a115af042 Various improvements 2022-07-13 12:15:10 +02:00
Ilya Laktyushin
6933a189a4 Add deletion search shortcut 2022-06-30 22:45:10 +03:00
Ali
dfad27f9e8 Refactoring 2022-05-29 21:09:11 +04:00
Ali
e8d124c812 Refactoring 2022-05-28 18:26:23 +04:00
Ali
0609f2bdf3 Fix build 2022-05-21 01:21:56 +03:00
Ali
3e27c499b3 Merge commit 'e99df956c2' 2022-05-21 01:16:33 +03:00
Ali
274f05d80a Animated emoji 2022-05-21 01:16:29 +03:00
Ilya Laktyushin
10326f1fac Fix build 2022-05-19 21:17:12 +04:00
Ali
c7c24a6c60 Make all sounds cloud 2022-04-08 00:17:15 +04:00
Ilya Laktyushin
d3361962b6 Web app improvements 2022-04-05 16:50:09 +04:00
Ilya Laktyushin
91d94884e8 Various Improvements 2022-03-23 00:54:05 +04:00
Ali
a9c595a640 Another feed experiment 2022-03-18 22:55:06 +04:00
Ilya Laktyushin
4fef982671 Various settings UI improvements 2021-10-26 17:30:12 +04:00
Ali
1141e09c1b Refactoring 2021-09-07 13:09:06 +04:00
Ali
1a04fb4408 Refactor SyncCore back into TelegramCore 2021-07-21 21:43:20 +02:00
Ali
9134bae908 Refactoring 2021-07-07 01:59:12 +04:00