Commit graph

113 commits

Author SHA1 Message Date
Ilya Laktyushin
e0f4655cc5 Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios 2026-05-29 09:24:16 +02:00
Ilya Laktyushin
91eb779ae2 Merge commit 'c64653ed37' 2026-05-14 12:45:26 +02:00
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
a5432e44a8 Postbox -> TelegramEngine wave 16b: ItemListPeerItem.Context engine: collapse
ItemListPeerItem.Context.Custom's init took (postbox: Postbox, network: Network)
purely to forward them to downstream AvatarNode.setPeer and EmojiStatusComponent.
Collapse to engine: TelegramEngine (wave-11 pattern, engine handle preferred per
the standing guidance since the sole external caller is main-app, not
Share-Extension).

Surface changes:
- Context.Custom: two stored fields (postbox, network) -> one (engine); init
  param pair -> single engine:.
- Context: computed postbox/network -> computed engine.
- Six internal forwards route via item.context.engine.account.postbox/.network.

External caller (sole .custom(Custom(...)) construction site codebase-wide):
- PeerInfoSettingsItems.swift:121 -> pass engine: peerAccountContext.engine
  (the accountsAndPeers tuple already carries AccountContext, which exposes
  .engine: TelegramEngine).

All 37 other ItemListPeerItem(...) sites use the .account(context: AccountContext)
convenience overload unchanged.

Module does NOT become Postbox-free: PeerStoryStats? (public surface on
storyStats) and, via the now-unavoidable Postbox import, a handful of other
transitive Postbox types remain reachable. PeerStoryStats is deeply baked into
Postbox view types (PeerView, PeerStoryStatsView, ChatListEntry, MessageHistoryView,
Postbox.getPeerStoryStats) and moving it would require a cross-module wrapper
rewrite out of scope here. EngineMessageHistoryThread.Info (the other
previously-blocking public-surface type) was moved to TelegramCore in the
preceding wave 16a commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 21:30:19 +02:00
Ilya Laktyushin
22df2dbdb9 Various fixes 2026-04-14 03:33:34 +02:00
Ilya Laktyushin
5018fd7c65 Added dates in poll results 2026-02-22 01:37:19 +04:00
Ilya Laktyushin
d9d1210c1d Various improvements 2026-02-19 21:53:26 +04:00
Isaac
962a9ae83a Various improvements 2026-01-30 22:20:50 +08:00
Isaac
4a13c3830a Glass 2025-12-26 20:29:30 +08:00
Ilya Laktyushin
0915a42e64 Various improvements 2025-10-16 05:30:06 +04:00
Isaac
b9b38e5fbf Various improvements 2025-10-11 00:56:21 +08:00
Ilya Laktyushin
fb7b93fbdc Various improvements 2025-09-22 07:45:25 +04:00
Isaac
f90402102b [WIP] Monoforums 2025-05-14 00:50:46 +08:00
Isaac
140efd6cfd [WIP] Monoforums 2025-05-10 18:02:55 +01:00
Isaac
0e119dd6f1 [WIP] Monoforums 2025-05-08 20:56:55 +01:00
Ilya Laktyushin
681b5c9d3a Various improvements 2025-01-28 19:59:32 +04:00
Ilya Laktyushin
db5b3f3afd Various fixes 2025-01-02 19:33:53 +04:00
Ilya Laktyushin
3bf092aff8 Various fixes 2025-01-02 04:03:51 +04:00
Ilya Laktyushin
acae4de3fb Various fixes 2024-12-28 16:29:12 +04:00
Ilya Laktyushin
5d4213c4fc Various improvements 2024-12-27 23:04:34 +04:00
Ilya Laktyushin
6e850130fd Update API [skip ci] 2024-12-26 07:27:14 +04:00
Ilya Laktyushin
5451053195 Various improvements 2024-12-22 17:16:14 +04:00
Ilya Laktyushin
2bf11a6279 Various improvements 2024-08-09 17:43:47 +02:00
Ilya Laktyushin
df311bb022 Stars subscriptions 2024-08-06 22:40:17 +02:00
Ilya Laktyushin
914dbc46f6 Recent actions improvements 2024-04-23 12:01:28 +04:00
Isaac
ba55877c44 Poll emoji improvements 2024-04-22 19:21:35 +04:00
Isaac
9cfdc27443 Various improvements 2024-03-27 19:00:12 +04:00
Isaac
19719dc7d4 Business improvements 2024-03-26 12:40:18 +04:00
Isaac
925665b88b Premium users in privacy settings 2024-03-15 19:29:04 +04:00
Isaac
6eb222809d Various improvements 2023-12-29 21:21:20 +04:00
Isaac
0e75f18f14 [WIP] Saved messages 2023-12-25 22:58:09 +04:00
Isaac
09e025e985 [WIP] Channel appearance 2023-12-15 22:59:33 +04:00
Ilya Laktyushin
bd8f2dae27 Various fixes 2023-11-27 00:18:25 +04:00
Ali
d81b2e9f8c Fix memory leaks 2023-09-25 18:41:03 +04:00
Ali
f1a01e343b Stories 2023-07-12 20:18:01 +04:00
Ali
008b52a250 Stories 2023-07-09 02:07:53 +04:00
Ali
15e1243af5 Merge commit '6ec1583781' 2023-03-24 21:43:39 +04:00
Ali
6f04ec274f Folder improvements 2023-03-24 21:42:22 +04:00
Ilya Laktyushin
85408023ab Fix forum & topics notification settings 2023-03-24 16:26:59 +04:00
Ali
c0dbb68a3c [WIP] Folders 2023-03-21 23:38:48 +04:00
Ali
a78924ccd9 Folders 2023-03-17 23:35:52 +04:00
Ilya Laktyushin
e3498e99a1 Various improvements 2022-11-23 14:47:30 +04:00
Ilya Laktyushin
e85b6cac30 Various improvements 2022-10-19 02:20:01 +03:00
Ali
02b28ee6fc [WIP] Topics 2022-10-18 01:08:49 +04:00
Ali
ab76f8b02a [WIP] Reaction UI improvements 2022-09-14 00:03:32 +04:00
Ali
8023a47895 Fix fake icons 2022-09-06 19:30:50 +04:00
Ali
2af9c675a7 Animation and theme improvements 2022-08-30 21:06:33 +04:00
Ali
b924ea326e Emoji status and reaction improvements 2022-08-30 18:38:47 +04:00
Ali
3b636d5cb9 Emoji status and reaction improvements 2022-08-26 20:28:11 +03:00
Ali
c535d51621 Emoji status and reaction improvements 2022-08-26 13:33:32 +03:00