Commit graph

141 commits

Author SHA1 Message Date
isaac
0050cc7a08 Rich-message media in gallery/shared-media/preview pipelines via Message.effectiveMedia
Add Message/EngineMessage.effectiveMedia (= message.media when non-empty, else
richText.instantPage.allMedia()) and route the media-consuming sites through it
so a rich message's instant-page media participates in the same pipelines as
normal message.media: shared-media grids/file-rows, search media grid, gallery
open + item nodes + footer, the peer audio/voice playlist, secret-media preview,
resource-by-id resolution, recent downloads, downloaded-media store, delete-time
resource cleanup, cache-usage stats, the in-chat download manager, and the
context-menu / share actions (Save to Camera Roll, copy image, save audio/music
to files). For normal messages effectiveMedia == message.media, so each swap is
behavior-preserving; rich messages render their own bubble via
ChatMessageRichDataBubbleContentNode (not the text/file bubbles), so those paths
are deliberately untouched, as are the forward path (the attribute travels with
the forward) and the markdown-based rich-edit path. First-media scope for now.

See docs/instantpage-richtext.md for the full architecture + invariants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:46:56 +02:00
isaac
f6da30da70 InstantPage V2: audio/music rendering, playback, and file-bubble styling
Render and play InstantPageBlock.audio in the InstantPage V2 renderer
(rich-data message bubbles + the rich send preview), where audio was
previously an inert grey placeholder.

- New InstantPageV2AudioContentNode replicates the standard music message
  bubble (ChatMessageInteractiveFileNode's music layout): a SemanticStatusNode
  control (album art via playerAlbumArt + play/pause) with a download/progress
  overlay, title + "duration · performer" lines, exact fonts/colors from
  theme.chat.message.{incoming|outgoing}. Tap is driven by a
  UITapGestureRecognizer (ASControl .touchUpInside is cancelled by the chat
  ListView's gesture system). V1's InstantPageAudioNode is unchanged.
- Playback runs on InstantPageMediaPlaylist with a discriminated, message-scoped
  InstantPageMediaPlaylistId (.instantPage / .richMessage) so concurrent
  rich-message audio bubbles don't collide; the big control's play/pause comes
  from filteredPlaylistState, the overlay's download/progress from
  messageMediaFileStatus, and fetch goes through the fetch manager.
- Rich-message audio fetches via a MessageReference (threaded through the V2
  render context) instead of the synthesized webpage; FetchedMediaResource's
  .message revalidation arm now also searches RichTextMessageAttribute instant
  pages, so a stale instant-page audio/image reference can recover. Corrected a
  dormant inverted InstantPagePlaylistLocation.isEqual.
- New .mediaAudio laid-out item + layout/reveal-cost arms; the audio block lays
  out full-width at the file node's music normHeight.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 17:44:45 +02:00
isaac
e918b353ec Postbox refactor waves 278-356: squash
Squashes 79 sequential refactor waves into a single commit.

Highlights:
- Drop `import Postbox` (and matching `//submodules/Postbox` BUILD deps) from a wide swath of consumer files: ChatList, ChatMessage*BubbleContentNode subclasses, ListMessageNode/ListMessageItem, GalleryData, ChatHistorySearchContainerNode, ChatPanelInterfaceInteraction, ChatControllerInteraction, ChatMessageStickerItemNode, ChatMessageReplyInfoNode, ChatMessageInstantVideoItemNode, ChatPresentationInterfaceState, BrowserMarkdown/Readability, MediaResources, LocalMediaResources, ICloudResources, FetchManager, ShareController, OpenChatMessage, GalleryController, GroupStickerSearchContainerNode, GroupStickerPackCurrentItem, ChatPinnedMessageTitlePanelNode, OverlayAudioPlayerController, PresentationThemeSettings, StatisticsUI/StoryIconNode, TextFormat/StringWithAppliedEntities, GalleryUI/VideoAdComponent, StickerPackPreviewUI, WallpaperPreviewMedia, WallpaperResources, YoutubeEmbedImplementation, InstantPageExternalMediaResource, PlatformRestrictionMatching, TelegramUIDeclareEncodables, ChatListNode/ChatListSearchContainerNode.
- Add `TelegramEngine` facades: `Themes.wallpapers`, `Themes.themes`, `AccountData.addAppLogEvent`.
- Add `EngineMessageHistoryEntryLocation` wrapper.
- Add `EngineRaw*` escape-hatch typealiases (`EngineRawMessage`, `EngineRawPeer`, `EngineRawMedia`, `EngineRawMediaResource`, `EngineRawMediaResourceData`, `EngineRawItemCollectionItem`, `EngineRawItemCollectionInfo`) and `engineDeclareEncodable` forwarder.
- Drop unused `account:`/`postbox:`/`network:` parameters from several public functions and delete the dead overloads/types/functions left over: `automaticThemeShouldSwitchNow`, `cancelFreeMediaFileInteractiveFetch`, `legacyEnqueueVideoMessage`, `TelegramMediaFileReference`, plus assorted dead public TelegramCore/AccountContext SecureId entry points.
- Delete entire dead modules: `LegacyDataImport`, `TonBinding`, `SpotlightSupport`, `SvgRendering`, third-party `AppCenter`/`VectorPlus`/`SwiftColor`/`SwiftSVG`.
- Drop orphan `//submodules/Postbox` BUILD deps across 3 cleanup rounds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 14:11:06 +02:00
Ilya Laktyushin
22df2dbdb9 Various fixes 2026-04-14 03:33:34 +02:00
Ilya Laktyushin
21adc7d061 Various improvements 2026-03-30 02:55:35 +02:00
Ilya Laktyushin
53d5425341 Various fixes 2026-03-28 18:27:01 +01:00
Isaac
cb802c524e Revert "Experiment"
This reverts commit 8c54db62f3.
2026-02-04 18:01:32 +08:00
Isaac
8c54db62f3 Experiment 2026-02-04 03:22:37 +08:00
Isaac
50c5cc9616 Refactor constructor use sites for types 560-579 to struct pattern
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 00:40:53 +08:00
Isaac
33a0d9e62c Refactor Api types 120-149 to use struct-wrapped constructors
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 03:00:59 +08:00
Isaac
6b2c0f9c53 Refactor constructor use sites for types 100-119 to struct pattern
Migrated 22 constructors: fileHash, folder, folderPeer, forumTopic,
forumTopicDeleted, foundStory, game, geoPoint, geoPointAddress,
globalPrivacySettings, groupCall, groupCallDiscarded, groupCallDonor,
groupCallMessage, groupCallParticipant, groupCallParticipantVideo,
groupCallParticipantVideoSourceGroup, groupCallStreamChannel,
highScore, importedContact, inlineBotSwitchPM, inlineBotWebView

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 02:41:47 +08:00
Isaac
68d60d34dc Refactor Api types 43-52 to use struct-wrapped constructors
Also adds -warnings-as-errors to TelegramCore Package.swift

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 00:33:37 +08:00
Isaac
9f757cbf74 Refactor Api types 33-42 to use struct-wrapped constructors
Types refactored:
- BusinessBotRecipients, BusinessBotRights, BusinessChatLink
- BusinessGreetingMessage, BusinessIntro, BusinessLocation
- BusinessRecipients, BusinessWeeklyOpen, BusinessWorkHours, CdnConfig

Updated pattern matching and construction sites in TelegramCore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 19:41:25 +08:00
Isaac
8f1c9019be Passkeys 2025-12-02 01:43:04 +08:00
Isaac
6b330351e1 Stories 2025-11-06 12:53:18 +04:00
Ilya Laktyushin
66a614a9a4 Update API 2025-08-20 22:31:58 +04:00
Ilya Laktyushin
ba5b9295a3 Update API 2025-08-18 13:44:14 +04:00
Ilya Laktyushin
8709581d6a Update API 2025-06-06 09:52:11 +02:00
Isaac
064ab69058 Fix disposable leak 2025-05-07 22:07:50 +01:00
Isaac
51a657c41c Conference updates 2025-04-07 18:13:22 +04:00
Ilya Laktyushin
ef3eb05d69 Frozen account improvements 2025-03-19 14:39:39 +04:00
Isaac
1fb93ab298 Various improvements 2025-02-25 14:46:07 +00:00
Isaac
6c4070eb52 Serialization update 2025-02-14 19:11:58 +04:00
Isaac
2da0f6fcc4 Add recaptcha 2025-01-31 21:04:26 +04:00
Ilya Laktyushin
ed12e35f18 Add video cover file ref update 2025-01-29 16:48:48 +04:00
Isaac
4e964d4546 Various improvements 2024-12-06 22:15:52 +08:00
Isaac
af267cae64 Video player and calls 2024-09-20 22:33:36 +08:00
Isaac
923587b0da [WIP] Dynamic video streaming 2024-09-18 01:04:29 +08:00
Ilya Laktyushin
5978a5278d Local instant view 2024-08-29 11:44:05 +04:00
Ilya Laktyushin
a28ec1d157 Update API 2024-07-01 20:23:26 +04:00
Mikhail Filimonov
136e0fa370 macos related changes 2024-06-28 13:38:44 -03:00
Ilya Laktyushin
e47b5a89ef Paid media improvements 2024-06-24 04:06:57 +04:00
Isaac
ad9a903f21 Make FetchV2 the default 2024-06-11 17:53:58 +04:00
Isaac
1b64858bab Fix check 2024-05-16 19:38:49 +04:00
Isaac
4ac12021d5 Request verification 2024-05-15 21:09:50 +04:00
Ilya Laktyushin
ee8d330526 Fix typo 2024-05-11 13:25:49 +04:00
Ilya Laktyushin
ee2b7be5e2 [WIP] Stickers editor 2024-04-06 19:53:19 +04:00
Isaac
b280856c9e Bot chat exceptions 2024-03-26 19:43:56 +04:00
Isaac
08ee841e45 UI improvements 2024-03-20 23:35:34 +04:00
Isaac
2a2d468fd9 Add back changes 2024-03-15 16:13:38 +04:00
Isaac
d8e5ff4f58 Various improvements 2023-12-28 19:55:39 +04:00
Isaac
b34a495945 [WIP] Saved messages 2023-12-12 14:05:58 +04:00
Mike Renoir
677f1584c7 macos 10.14 to 14.0 2023-12-08 13:21:34 +04:00
Ali
2ba969a5cb Fix NetworkHelper deallocation after adopting weak in MTContext 2023-11-08 16:37:21 +04:00
Ali
2430d2b7bc Fix memory leaks 2023-10-31 17:56:10 +04:00
Ali
30639d9a88 Memory leak fixes 2023-09-26 16:55:04 +04:00
Ilya Laktyushin
065553abd4 Update API 2023-09-25 14:46:58 +04:00
Ali
2091b47bb0 Fix NSKeyedUnarchiver usage 2023-09-23 13:33:04 +04:00
Ali
b7fbcbf118 Upgrade to iOS 12 2023-09-23 12:38:29 +04:00
Ali
b041ba84a9 Stories 2023-09-18 19:46:56 +02:00