Skip to content

Handle rich bot message fallback for macOS#4

Draft
ohld wants to merge 2 commits into
overtake:macos-11.14-releasefrom
ohld:codex/telegramios-rich-message-fallback
Draft

Handle rich bot message fallback for macOS#4
ohld wants to merge 2 commits into
overtake:macos-11.14-releasefrom
ohld:codex/telegramios-rich-message-fallback

Conversation

@ohld

@ohld ohld commented Jun 25, 2026

Copy link
Copy Markdown

What

Adds compatibility parsing for newer Telegram TL constructors seen by the macOS client when loading Bot API rich messages, including richMessage, newer poll/media/update variants, reply headers, keyboard buttons, stories, gifts, and topic message containers.

The goal is graceful fallback rendering instead of leaving bot rich messages as unsupported media placeholders.

Why

Recent bot messages using newer rich formatting can be delivered to this older macOS client as unsupported media. When the client later requests the rich message payload, parsing may fail on newer TL constructors such as messageMediaPoll#773f4e66, poll#966e2dbf, pollResults#ba7bb15e, and updateMessagePoll#d64c522b.

Notes

  • messages.getRichMessage is tried before the older unsupported-media refresh methods.
  • RichMessage blocks are converted into a plain-text fallback, preserving readable text when native rich block rendering is absent.
  • Newer constructor wrappers consume extra fields and map back to existing model cases where possible.

Verification

  • swift build in submodules/TelegramApi: passed.
  • macOS app rebuild through the parent TelegramSwift workspace: passed.
  • Fresh Telegram Dev RichTest log for https://t.me/ohld_chat/35423 after restart:
    • This message is not supported: 0
    • messageMediaUnsupported: 0
    • d64c522b: 0
    • 49e91f2a: 0
    • 7600b9d3, baf39d8b, 773f4e66, 966e2dbf, ba7bb15e: 0

Local test artifact from parent workspace:
/Users/ohld/Documents/GitHub/TelegramSwift/artifacts/Telegram-Dev-RichTest.dmg
SHA256: a4a572cbd789f140555753ffc436c686ba7fa7255b720c8e435dfca132af05a3

@ohld ohld changed the title Render Bot API rich messages as readable fallback text Handle rich bot message fallback for macOS Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant