Telegram github commits and releases
4.43K subscribers
601 files
21K links
Broadcast from the most important Telegram clients' repositories
Download Telegram
morethanwords/tweb/master • 96fb8c0 • 4 files, +227/-194
Fix intermittent SRP 2FA password rejection (unpadded A)

The client public value A = g^a mod p was serialized with its minimal
big-endian length instead of being zero-padded to 256 bytes. The server
normalizes A to 256 bytes before hashing u and M1, so whenever g^a mod p
had a leading zero byte (~1/256 of attempts) our M1 mismatched the
server's and a correct password was rejected at random; a retry (fresh
account.getPassword -> new a) usually succeeded. Pad A to 256 bytes
everywhere, exactly like tdlib's A_bn.to_binary(256).

While matching tdlib's PasswordManager::get_input_check_password:
- generate the ephemeral secret a from a fresh local CSPRNG instead of
the server-provided state.secure_random (which leaked the secret
exponent and was constant across the now-removed retry loop);
- add the validations that were commented-out stubs: verifyDhPrimeAndGenerator
(= check_config) for both the check and new-password paths, and the
srp_B range/length check (0 < B < p, 248 <= len <= 256).

Rewrite src/tests/srp.test.ts into a real suite: KDF vs an independent
Node-crypto reference, a client/server SRP round-trip x25, a forced
leading-zero-A regression (mutation-confirmed it fails on the unpadded
code), the isNew verifier path, and validation throws. Drop the stale
A/M1/srp_B fixtures and the dead src/mock/srp_original.ts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

morethanwords/tweb/master • c6fb69c • 2 files, +1/-8
Align reply-quote poll icon inline instead of flexing the subtitle

The poll-option checkmark in the reply/pinned container now carries the
standard inline-icon classes (inline-icon inline-icon-left) so it aligns
with the quote text through the normal inline flow, dropping the bespoke
.with-icon flex wrapper on the subtitle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

#webk
🫡3
morethanwords/tweb/master • 0aaab72 • 300 files, +571/-562
Build

#webk
🫡2
morethanwords/tweb/master • a5c7327 • 1 files, +42/-19
Fix video streaming edge cases in service worker

- Fall back to the worker on any cache read error (incl. a bare cache
timeout that rejects with undefined) instead of throwing TypeError on
error.type and killing the range request
- Preload the file's last chunk at start (moov/bounds) instead of chunk 0
- Treat PRELOAD_SIZE as a read-ahead window from the current position
rather than an absolute end offset (read-ahead was dead past 20MB)
- Align the preload window start to the chunk grid so preloaded offsets
stay valid MTProto offsets
- Gate the second range part on overflow > 0 (a byte count was used as a
boolean, so a negative value forced a wasteful extra chunk fetch)
- Clamp limit to a server-valid minimum (4KB) to avoid LIMIT_INVALID on
tiny ranges; make SMALLEST_CHUNK_LIMIT a valid 4KB and use it
- Don't resurrect a destroyed stream from toggleStreamInUse(false); clamp
inUse at 0 to stop zombie streams leaking in the map
- Re-arm the idle debounce instead of destroying a stream still bound to
a live <video>
- Swallow rejections from best-effort cache writes and fire-and-forget
preloads to avoid unhandled rejections
- Use Math.clz32 in alignLimit to drop the Math.log FP rounding; remove
the unused Response-Time header

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

morethanwords/tweb/master • 99de4a8 • 2 files, +30/-4
Fix rich-text paste/serialization of newlines around blockquotes

Three related fixes in the contenteditable rich-text path:

- getRichValueWithCaret paste reconciliation: the re-insertion pass used a
drifting offset threshold (`offset > plainTextLength - lineIndex + 1`) that
was only correct for one line index, shifting/losing entities on multi-line
formatted pastes (e.g. a second line in bold). Use the splice index directly
and adjust entity length, not just offset, in both removal and insertion.

- Paste handler: strip messageEntityLinebreak before insertRichTextAsHTML.
wrapDraftText renders line breaks from the text itself; passing explicit
linebreak entities made wrapRichText slice the one before a blockquote,
dropping a \n on e.g. `text\n\nquote`. Stripping them aligns paste with the
edit/draft path (verified: no extra blank line, model preserves both \n).

- getRichElementValue: a multiline blockquote built from block children
(<br>/<div>, what Enter produces) lost its last character outside the quote,
because the entity length is only grown by text nodes while block-generated
\n bypass it. Track the last real-content offset and re-span the blockquote
up to it, excluding trailing block line breaks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

#webk
🫡3
telegramdesktop/tdesktop/chrome_149.0.0.0 • 0830bf3 • 1 files, +1/-1
Update User-Agent for DNS to Chrome 149.0.0.0.

#tdesktop
🫡2
telegramdesktop/tdesktop/unused_styles_2026_07 • 1af2be2 • 1 files, +0/-8
Removed 4 unused style entries.

#tdesktop
🫡2
telegramdesktop/tdesktop/dev • aad218a • 1 files, +0/-8
Removed 4 unused style entries.

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • cf661e5 • 1 files, +1/-1
Update User-Agent for DNS to Chrome 149.0.0.0.

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • 3a528d8 • 2 files, +6/-3
Move -fuse-ld=lld to linker flags

telegramdesktop/tdesktop/dev • 6fcd650 • 1 files, +0/-8
Remove cmake policy linking error workarounds

telegramdesktop/tdesktop/dev • a2d3b37 • 3 files, +3/-5
Restore cmake 3.25 as minimum version

telegramdesktop/tdesktop/dev • fa3948d • 1 files, +3/-5
Use theme change event from qApp

telegramdesktop/tdesktop/dev • 09459d1 • 1 files, +9/-8
CreateOfficialIcon -> CreateSupportIcon

That better fits the current meaning

telegramdesktop/tdesktop/dev • 84b0f73 • 1 files, +4/-0
Preserve window icon name on Wayland

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • f1df250 • 1 files, +1/-1
Update lib_ui.

#tdesktop
🫡3
morethanwords/tweb/master • 3acb5a4 • 3 files, +295/-0
Add run-build skill to list and serve past build snapshots

Lists the git "Build" commits (compiled app in public/) as a paginated,
date-sorted table, then serves any chosen snapshot locally by extracting
that commit's public/ tree via git archive — mirroring server.js and
leaving the working tree untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

#webk
🫡2
Ajaxy/telegram-tt/master • f33f22a • 3 files, +4/-4
12.0.32

Ajaxy/telegram-tt/master • 360de48 • 16 files, +188/-37
Support startGroup deep link for bots (#7050)

Ajaxy/telegram-tt/master • 8f8cc05 • 1 files, +12/-3
Modal: Autofocus title by default (#7068)

Ajaxy/telegram-tt/master • 24fab59 • 3 files, +43/-20
Surface Container: Fix background color (#7071)

Ajaxy/telegram-tt/master • 63b505e • 1 files, +4/-1
Profile: Improve closing on Esc logic for profiles (#7070)

Ajaxy/telegram-tt/master • e3318c0 • 2 files, +7/-0
Passcode: Fix button spacing in passcode settings (#7069)

Ajaxy/telegram-tt/master • db6db81 • 5 files, +37/-23
Passcode: Persist shared state to fix theme flicker on unlock (#7066)

Co-authored-by: Dmitry Kabanov <153344039+dmitrykabanovdev@users.noreply.github.com>

Ajaxy/telegram-tt/master • 55557c2 • 6 files, +20/-11
Middle Header Panel: Fix styles (#7072)

Ajaxy/telegram-tt/master • 6a0d49f • 29 files, +587/-240
Middle Column: Redesign composer and chat panels mask (#7059)

Co-authored-by: Alexander Zinchuk <alx.zinchuk@gmail.com>

Ajaxy/telegram-tt/master • 3b3fde0 • 1 files, +19/-6
Mini Apps: Fix miniAppsCachedSize saving after fullscreen (#7074)

Ajaxy/telegram-tt/master • eb9f746 • 88 files, +246/-246
[Build]

#webz
🫡2
telegramdesktop/tdesktop/dev • 7bc0e17 • 1 files, +0/-1
Removed dead deep copy of reactions in unread lookup.

telegramdesktop/tdesktop/dev • 0426e19 • 1 files, +3/-0
Fixed quick-action icon loss after swipe returns to origin in dialogs.

telegramdesktop/tdesktop/dev • abf77d7 • 2 files, +8/-19
Replaced flattened table rows with label in rich reply previews.

telegramdesktop/tdesktop/dev • 94af158 • 1 files, +1/-10
Fixed extra empty space below short member lists in info profiles.

telegramdesktop/tdesktop/dev • e2a6a08 • 2 files, +2/-1
Fixed profile scroll bar sliding under flexible top bar scroll.

telegramdesktop/tdesktop/dev • 8457d13 • 1 files, +6/-2
Fix escaping in HTML export of keyboards.

telegramdesktop/tdesktop/dev • 673d3d3 • 9 files, +18/-37
Revert "Disable IV editor for now."

This reverts commit 9a234182e1e8b3e099719404378b10f374a21731.

telegramdesktop/tdesktop/dev • 869941c • 9 files, +378/-200
Check for changes in rich message.

telegramdesktop/tdesktop/dev • f7c2ff3 • 2 files, +18/-7
Support Ctrl+X to cut block selections.

telegramdesktop/tdesktop/dev • a47aad4 • 3 files, +70/-0
Close editors on session destructions.

telegramdesktop/tdesktop/dev • 388da4b • 37 files, +2773/-178
Improve editor top bar controls.

telegramdesktop/tdesktop/dev • 6b970df • 7 files, +627/-38
Improve math formula edit with a box.

telegramdesktop/tdesktop/dev • 732df97 • 3 files, +182/-110
Improve emoji toggle, italic icon.

telegramdesktop/tdesktop/dev • b667228 • 3 files, +346/-47
Improve undo/redo and single-block Ctrl+A.

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • 6508c98 • 24 files, +195/-49
Improve icons in the editor.

telegramdesktop/tdesktop/dev • 8b73413 • 7 files, +734/-37
Improve inter-blocks navigation.

telegramdesktop/tdesktop/dev • 05455fb • 3 files, +379/-50
Fix incorrect scroll jumps and block selections.

telegramdesktop/tdesktop/dev • 8d42262 • 11 files, +1169/-103
Implement some media management.

telegramdesktop/tdesktop/dev • 2027d35 • 2 files, +451/-122
Improve arrows navigation through text nodes.

telegramdesktop/tdesktop/dev • 748bc82 • 9 files, +2855/-85
Allow drag-n-drop of blocks selections.

telegramdesktop/tdesktop/dev • 282d647 • 22 files, +1781/-298
Support nice ordered list editing.

telegramdesktop/tdesktop/dev • 9dc4b8c • 24 files, +2356/-241
Support rich messages drafts.

telegramdesktop/tdesktop/dev • f68b30b • 12 files, +246/-298
Improve rich message draft preview.

telegramdesktop/tdesktop/dev • 67f4756 • 6 files, +382/-53
Improve draft preview, make it rich.

telegramdesktop/tdesktop/dev • ec7e056 • 13 files, +594/-161
Improve rich messages serialization.

telegramdesktop/tdesktop/dev • c0cb889 • 4 files, +621/-29
Improve block creation / wrapping.

telegramdesktop/tdesktop/dev • 348f916 • 3 files, +315/-9
Correct handling monospace/codeblock shortcuts.

telegramdesktop/tdesktop/dev • 60cd894 • 2 files, +15/-5
Fix copy of codeblock from rich message.

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • 31d1cb7 • 4 files, +1163/-81
Improve selection by keyboard.

telegramdesktop/tdesktop/dev • ff86735 • 2 files, +41/-14
Normalize rich draft compose controls

telegramdesktop/tdesktop/dev • 1f87c04 • 11 files, +342/-15
Send previewed rich drafts from compose

telegramdesktop/tdesktop/dev • af71b4c • 8 files, +218/-24
Redesign rendered pullquotes

telegramdesktop/tdesktop/dev • eecda90 • 8 files, +178/-27
Make pullquote edits resize live

telegramdesktop/tdesktop/dev • 90d1dd3 • 2 files, +34/-0
Add three-state editor toolbar button helper

telegramdesktop/tdesktop/dev • 19e759b • 8 files, +218/-18
Add pill-group background for toolbar buttons

telegramdesktop/tdesktop/dev • 039367f • 1 files, +105/-759
Lay out IV editor top toolbar as pill groups

telegramdesktop/tdesktop/dev • cc192fd • 1 files, +11/-4
Lay out IV editor top toolbar as pill groups

telegramdesktop/tdesktop/dev • 9e1715f • 1 files, +2/-8
Lay out IV editor top toolbar as pill groups

telegramdesktop/tdesktop/dev • 5af16f9 • 7 files, +64/-24
Scroll IV editor content under the top pills with a fade

telegramdesktop/tdesktop/dev • 224b740 • 1 files, +30/-3
Shadow IV emoji column and toggle emoji button state

telegramdesktop/tdesktop/dev • 0a0f56d • 8 files, +64/-3
Add floating close button over IV emoji column

telegramdesktop/tdesktop/dev • c89afaa • 4 files, +329/-7
Make IV editor toolbar style menus context-aware

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • a36e7e6 • 3 files, +91/-5
Make IV editor table toolbar button context-aware

telegramdesktop/tdesktop/dev • 0da9840 • 10 files, +100/-21
Add IV editor attach, link and formula button behaviors

telegramdesktop/tdesktop/dev • 0eec90b • 3 files, +184/-0
Add live preview to the IV formula editor

telegramdesktop/tdesktop/dev • 75a57cd • 3 files, +47/-6
Anchor IV editor toolbar pills to the article column

Lay out the toolbar pills with even skips at minimal width and keep the undo/redo and controls group on the article's left edge while the emoji pill tracks its right edge.

telegramdesktop/tdesktop/dev • 86ee3ce • 1 files, +6/-4
Keep IV toolbar pills non-overlapping at min width

telegramdesktop/tdesktop/dev • dc3211f • 1 files, +24/-1
Make IV editor toolbar pill buttons clickable

telegramdesktop/tdesktop/dev • 8c054dc • 10 files, +418/-51
Fix pullquote width remeasure

telegramdesktop/tdesktop/dev • ec8b212 • 3 files, +18/-5
[ai] Use smartest model / highest reasoning.

telegramdesktop/tdesktop/dev • b0c4f29 • 9 files, +200/-8
[ai] Add -testagent for silent crashes.

telegramdesktop/tdesktop/dev • e3f0a36 • 1 files, +3/-0
Fix possible crash in paid reactions.

telegramdesktop/tdesktop/dev • d14c8f4 • 1 files, +10/-1
Fit 8 emoji per row in IV editor column

telegramdesktop/tdesktop/dev • 11300bf • 4 files, +45/-13
Shrink IV emoji close button and clear search field

telegramdesktop/tdesktop/dev • 21a2771 • 3 files, +17/-12
Resize and restyle the IV formula editor preview

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • 8b6d76d • 1 files, +34/-1
Show random LaTeX samples in formula editor

telegramdesktop/tdesktop/dev • 20ae027 • 6 files, +18/-10
Update IV editor toolbar and menu icons

telegramdesktop/tdesktop/dev • 045604b • 1 files, +23/-0
Restore IV editor Toggle Block and Map menu entries

telegramdesktop/tdesktop/dev • bb28391 • 1 files, +1/-1
Strengthen IV editor top fade under toolbar

telegramdesktop/tdesktop/dev • 2f40c2c • 3 files, +26/-7
Cap IV editor content width to the toolbar span

Photos and other inserted blocks no longer grow past the top
controls; the article column and the floating top pills stay
centered together at the same position when the window widens.

telegramdesktop/tdesktop/dev • f767256 • 1 files, +4/-7
Lay out IV editor article to the full toolbar span

telegramdesktop/tdesktop/dev • 0fd49da • 3 files, +42/-19
Float IV editor bottom controls over full-height scroll

telegramdesktop/tdesktop/dev • fd09457 • 2 files, +78/-32
Turn IV editor bottom controls into icon pills

telegramdesktop/tdesktop/dev • e2da54a • 4 files, +23/-26
Enlarge IV emoji close button and clear scroll bar

telegramdesktop/tdesktop/dev • 0ad1882 • 1 files, +3/-1
Make IV emoji search field gap symmetric

telegramdesktop/tdesktop/dev • 5378e7a • 2 files, +9/-5
Shorten emoji search pill for reserved right space

telegramdesktop/tdesktop/dev • 8851735 • 2 files, +9/-1
Apply edit drafts while IV editor owns thread draft

telegramdesktop/tdesktop/dev • f6137ce • 6 files, +155/-8
Switch between composing and editing rich messages

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • aaafc9f • 2 files, +29/-0
Repaint IV editor article on theme change

telegramdesktop/tdesktop/dev • 9d5320c • 6 files, +75/-9
Show media context menu only over media

telegramdesktop/tdesktop/dev • 08051fe • 3 files, +19/-1
Target collage spoiler at the clicked media item

telegramdesktop/tdesktop/dev • 142265f • 1 files, +1/-1
Fix crash in table deselection.

telegramdesktop/tdesktop/dev • 2606e4e • 5 files, +24/-23
Fix build with Xcode.

telegramdesktop/tdesktop/dev • 938ec73 • 4 files, +9/-8
Fix attach submenu in editor.

telegramdesktop/tdesktop/dev • 7ac3794 • 4 files, +207/-5
Insert IV blocks from dragged or pasted media files

telegramdesktop/tdesktop/dev • 5141c26 • 1 files, +9/-6
Reserve marker-column indent for nested task lists

telegramdesktop/tdesktop/dev • 1b13876 • 1 files, +1/-0
Position send button nicely in the editor.

telegramdesktop/tdesktop/dev • f854d0c • 2 files, +59/-30
Keep table h-scroll after changing list type

telegramdesktop/tdesktop/dev • 0f176a4 • 7 files, +49/-16
Make nice fade-to-background in IV editor.

telegramdesktop/tdesktop/dev • eee20b2 • 4 files, +29/-21
Make nice close button in emoji panel.

telegramdesktop/tdesktop/dev • 2732749 • 4 files, +26/-12
Use menu undo/redo icons in editors

telegramdesktop/tdesktop/dev • 1743eb0 • 3 files, +14/-4
Gate rich-message premium only at entry and send

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • e9caa13 • 2 files, +19/-7
Gray formula placeholder, re-roll sample on clear

telegramdesktop/tdesktop/dev • 45f0341 • 7 files, +40/-33
Make a better shadow for pills.

telegramdesktop/tdesktop/dev • c65aab2 • 10 files, +785/-178
Reuse existing media views for Slideshow.

telegramdesktop/tdesktop/dev • f68033d • 1 files, +1/-1
Fix build with Qt 5.

telegramdesktop/tdesktop/dev • 923f36e • 4 files, +12/-3
Replace Bordered table action with Borderless toggle

telegramdesktop/tdesktop/dev • 2a6f2e4 • 1 files, +16/-0
Show Unite cells in the top-control table menu

telegramdesktop/tdesktop/dev • 0818ea0 • 1 files, +11/-11
Swap attach and formula buttons in IV editor toolbar

telegramdesktop/tdesktop/dev • 8234f9f • 4 files, +85/-36
Round Send button and normal Discard pill in editor

telegramdesktop/tdesktop/dev • 05eb0db • 4 files, +52/-58
Round Save button and normal Cancel pill in editor

telegramdesktop/tdesktop/dev • 8362d8b • 2 files, +12/-2
Clamp editor auto-scroll between floating controls.

telegramdesktop/tdesktop/dev • 90fbd23 • 3 files, +155/-0
Send simple rich messages as normal text without premium

telegramdesktop/tdesktop/dev • 20d5499 • 3 files, +99/-1
Carry the field draft into the editor on Article

telegramdesktop/tdesktop/dev • 7e3ab2e • 1 files, +11/-9
Strip blockquote and code wrappers when splitting draft

telegramdesktop/tdesktop/dev • 2e72ebe • 5 files, +119/-0
Add Expand compose button to open the rich editor

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • e574f3a • 5 files, +129/-9
Open the media menu on click for spoilered media

telegramdesktop/tdesktop/dev • efa742b • 3 files, +55/-0
Remove only the clicked item from a Collage or Slideshow

telegramdesktop/tdesktop/dev • 54eb43f • 3 files, +132/-33
Autosave rich draft on each media upload.

telegramdesktop/tdesktop/dev • 36a6f83 • 5 files, +179/-7
Edit a photo in the media editor from the rich editor

telegramdesktop/tdesktop/dev • 7603a8b • 10 files, +484/-6
Overlay three-dot and add buttons on rich editor media

telegramdesktop/tdesktop/dev • 15ac77e • 12 files, +315/-52
Per-item controls and layout switch for grouped rich media

telegramdesktop/tdesktop/dev • fff550c • 3 files, +19/-1
Show nearest drop line for external file drag in editor

telegramdesktop/tdesktop/dev • 91f50c4 • 2 files, +5/-9
Fix IV editor discard/cancel glyph size and placement

telegramdesktop/tdesktop/dev • 96b631e • 6 files, +39/-5
Give each ordered-list type its own list-menu glyph

telegramdesktop/tdesktop/dev • 7f96642 • 6 files, +67/-2
Clear the source field when content moves to rich editor

telegramdesktop/tdesktop/dev • 9e6b5d7 • 1 files, +10/-16
Keep plain lines together when migrating field to editor

telegramdesktop/tdesktop/dev • 276dd14 • 6 files, +39/-0
Show the Expand button only for multi-line drafts

telegramdesktop/tdesktop/dev • 162abf9 • 1 files, +1/-0
Upload the edited photo from the rich editor

telegramdesktop/tdesktop/dev • 7a67710 • 6 files, +128/-33
Keep the slideshow active slide stable across edits

#tdesktop
🫡3
telegramdesktop/tdesktop/dev • cc247cc • 1 files, +0/-69
Reveal the spoiler on first click for grouped media

telegramdesktop/tdesktop/dev • 051bc0d • 7 files, +37/-6
Refresh rich-draft media references from the server draft

telegramdesktop/tdesktop/dev • 399b973 • 11 files, +132/-68
Fix some editor bugs.

telegramdesktop/tdesktop/dev • 3a4f39e • 2 files, +76/-0
Reflect the current cell selection in the top table button

On selection change the top bar derives its active block and menu from the live article selection instead of the previously edited node, so a multi-cell table rectangle always lights the table button and its menu offers Unite cells.

telegramdesktop/tdesktop/dev • 69a7a3c • 2 files, +89/-7
[ai] Add an optional visual/design step.

telegramdesktop/tdesktop/dev • 4ed9642 • 2 files, +83/-18
[ai] Ensure we continue as long as possible.

telegramdesktop/tdesktop/dev • c91afff • 1 files, +13/-1
Fix possible crash on AdminLog teardown.

telegramdesktop/tdesktop/dev • 402cb0e • 2 files, +10/-1
Fix crash when removing folders with pinned chats.

ChatFilters::applyRemove() emptied the filter in the list and only then
detached its chats. Unpinning a chat re-caches its siblings' pinned
indices, which runs Session::refreshChatListEntry(); seeing the filter
still listed but emptied, it re-entered removeFromChatList() ->
setChatPinned() -> PinnedList::setPinned() on the same pinned list while
its re-cache loop iterated with a cached size, reading past the end of
the vector. This aborted on closing the Folders editor after removing
two or more folders that had pinned chats.

Detach the filter from the list before applyChange() tears down its
chats, so the re-entrant refresh no longer touches it. Also harden the
setPinned() re-cache loop to re-check the container size each iteration
as defense in depth.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

telegramdesktop/tdesktop/dev • 057e8c5 • 1 files, +1/-1
Support tg://grams to show Grams section.

telegramdesktop/tdesktop/dev • 7a2555a • 1 files, +33/-9
Drop empty rich blocks and gate semi-empty on send

#tdesktop
🫡3