morethanwords/tweb/master • 088d690 • 7 files, +334/-53
Support guard-bot joins through their WebView (layer 228)
Layer 227 turned the join result into a union, and tweb handled the
web-view-gated branch by caching the bot and reporting no updates — the
user got nothing at all. Layer 228 splits that flow into an initial query
plus a separate messages.requestChatJoinWebView, so it can be driven.
processChatInviteJoinResult now returns a chatInviteJoinWebView descriptor
instead of undefined, and openWebApp grows a joinChat mode that requests
the guard bot's web view, tracks the query ids, and follows
updateJoinChatWebViewDecision: a webView result reloads the iframe with the
new url, while approved/declined/queued closes it and toasts the outcome,
opening the chat when the join went through.
Also make WebApp.destroy idempotent and bail out of the async init steps
once destroyed — the join flow can tear the popup down mid-init.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
morethanwords/tweb/master • 2d2f188 • 206 files, +30012/-2291
Implement Telegram Communities
morethanwords/tweb/master • 6619fdb • 14 files, +944/-73
Support guard bots end to end
Layer 228 hands a join off to a guard bot, which greets the newcomer in its
own mini app and answers the query. tweb only had the joining half, and its
outcome toast interpolated the chat title — which an invite-link join never
has, so a declined or queued join showed a hole where the name should be.
Joining side: the toast now uses the wording the official clients use and
tells a group from a channel without needing the title; an approved join
opens the chat through `open` so a forum lands on its topics tab; the
disclaimer names both the chat and the bot, ported from iOS. `loadExternal`
and the iframe show/hide it shared with `createWebView` no longer duplicate
each other.
Admin side, which was missing entirely: `toggleJoinRequest` carries the guard
bot (and clears it with `inputUserEmpty`), the bot's admin rights grow a
Process Join Requests switch with the enable and replace confirmations, and
the chat type screen names the guard bot by @username with a link to its
rights. Channels get the approval section they never had, so a guard bot set
there can also be seen and removed.
The ephemeral bot fixture gains Guard Mode: it answers join request queries
with approve, decline or queue, optionally showing a Mini App first. A query
it can no longer answer is logged and skipped rather than fatal — the same
update is redelivered until the batch is acknowledged, so dying on it wedges
the fixture forever on that one update.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
morethanwords/tweb/master • 62c3ad6 • 9 files, +99/-7
Support stars_spend_topup_invoice_disabled
Don't offer the Stars topup when the spend is attributed to a bot or a
channel and the app config forbids it — show a toast instead, like other
clients do.
The spend purpose peer is now resolved the same way as in tdesktop (bots
and channels only, monoforums resolve to their broadcast) and is used
both for inputStorePaymentStarsTopup.spend_purpose_peer and for the new
check. Paid messages, suggested posts and the "Buy Stars" service
buttons pass their peer as well now.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
#webk
Post #20518
131
- 🫡 3