mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Render RichText.textDate (API constructor textDate(flags, text, date)) as a
locale/timezone-correct, relative-aware, tappable date inside V2 rich-message
bubbles, reusing the existing stringForEntityFormattedDate autoformatter.
- Model: add RichText.textDate(text📅format:) with Postbox coding,
FlatBuffers schema (RichText.fbs; flatc regenerates), Equatable and plainText;
parse flags->DateTimeFormat? at the API boundary (flags==0 => nil, matching
the messageEntityFormattedDate convention) with a symmetric apiRichText()
round-trip. The new case is handled in every exhaustive RichText switch
(SyncCore, ApiUtils, InstantPageTextItem, InstantPageAnchorPath,
InstantPagePreviewText, BrowserReadability, BrowserMarkdown).
- Render: attributedStringForRichText gains an optional formatDate closure;
the V2 layout builds it from the message's strings/dateTimeFormat and threads
it to every text-building call site, formatting the timestamp and tagging the
run with TelegramTextAttributes.Date.
- Tappable: the Date attribute is added to linkSelectionRects hit-testing and
mapped in the rich bubble's entityTapContent to the existing .date tap action
(opens the date context menu).
- Live update: the V2 layout accumulates a page-wide formattedDateUpdatePeriod
(>=10s) for relative dates; the rich bubble schedules a refresh timer on it,
recreating it only when the period changes. The currentPageLayout cache is
bypassed for relative-date pages so the timer-driven relayout actually
re-formats the date.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| InstantPage.fbs | ||
| InstantPageBlock.fbs | ||
| ItemCollectionId.fbs | ||
| Media.fbs | ||
| MediaId.fbs | ||
| MessageId.fbs | ||
| Optional.fbs | ||
| PartialMediaReference.fbs | ||
| PeerAccessRestrictionInfo.fbs | ||
| PeerCollectibleColor.fbs | ||
| PeerEmojiStatus.fbs | ||
| PeerId.fbs | ||
| PeerNameColor.fbs | ||
| PeerReference.fbs | ||
| PixelDimensions.fbs | ||
| RichText.fbs | ||
| StarsAmount.fbs | ||
| StickerPackCollectionInfo.fbs | ||
| StickerPackReference.fbs | ||
| StoredDeviceContactData.fbs | ||
| TelegramChannel.fbs | ||
| TelegramChatAdminRights.fbs | ||
| TelegramChatBannedRights.fbs | ||
| TelegramGroup.fbs | ||
| TelegramMediaFile.fbs | ||
| TelegramMediaFileAttribute.fbs | ||
| TelegramMediaImage.fbs | ||
| TelegramMediaImageRepresentation.fbs | ||
| TelegramMediaResource.fbs | ||
| TelegramPeerAccessHash.fbs | ||
| TelegramPeerUsername.fbs | ||
| TelegramUser.fbs | ||
| VideoThumbnail.fbs | ||