Skip to content

feat: show a toast when reactions or forwarding are restricted - #69

Merged
macosswift merged 5 commits into
TelegramMessenger:masterfrom
X-OrBit:feat/restricted-action-toasts
Oct 29, 2026
Merged

macosswift merged 5 commits into
TelegramMessenger:masterfrom
X-OrBit:feat/restricted-action-toasts

Conversation

@X-OrBit

@X-OrBit X-OrBit commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Key change

Restricted actions now explain themselves, as on iOS:

  • In a chat where sending reactions is forbidden, the message context menu no longer offers the reactions panel. Tapping a reaction chip, double-clicking a message or using a star reaction shows "You cannot send reactions in this chat." with an animated "banned" icon.
  • In a chat with copy protection, the Forward button in the message selection panel stays clickable and shows "Forwards from this group/channel/bot are restricted" (or "Forwarding is restricted" for private chats) instead of doing nothing.
  • The star reaction highlight is a soft radial glow (as on iOS) instead of a rectangular gradient, so a panel with a single star reaction no longer draws a square into the bubble tail.

Reason

  • Reactions: in chats that forbid reactions the menu still offered them, a click set the reaction and the server then rolled it back, so users saw the reaction appear and disappear. iOS hides the panel and shows a toast (displaySendReactionRestrictedToast). ChatPresentationInterfaceState.canSendReactions mirrors canSendReactionsToPeer (default and personal banSendReactions, with the boost-to-unrestrict exception).
  • Forwarding: in the selection panel the Forward button looked the same enabled or disabled, so clicking it on protected content did nothing visible. iOS shows a copy-protection toast with the same texts.
  • Toast: ChatToasterView gets an optional animated icon via chatInteraction.showAnimatedToaster. The icon is banned.tgs, the gzipped iOS anim_banned.json (the same animation iOS uses for this toast), tinted with the text colour and played once. The only project.pbxproj change is the 4 lines that register this file.
  • Star highlight: the gradient layer was a rectangle inset by 2 px, and the panel mask includes the bubble tail, so with a single reaction the rectangle's corner was drawn inside the tail. The highlight is now a radial gradient fading to transparent, centered on the star and slightly larger than it.

Screenshot/video result (before/after)

Restricted reactions

Before

restricted-reactions-before.mp4

After

restricted-reactions-after.mp4

Restricted copy/reply

Before

restricted-share-before.mp4

After

restricted-share-after.mp4

Star reaction

Before

star-reaction-solo-before star-reaction-many-before

After

star-reaction-solo-after star-reaction-many-after

Confirmation

Steps:

  1. Open a group where reactions are disabled for you (admin setting). Right-click a message, click a reaction chip under a message, double-click a message.
  2. Open a group or channel with "Restrict saving content" enabled, choose "Select" on messages, click Forward.
  3. Open a channel that allows only star reactions and right-click a message; then a channel with stars and other reactions.
  4. Check a normal chat: the reactions panel is still in the menu and a reaction stays after clicking; Forward works.

Expected: step 1 shows no reactions panel and the toast instead of a reaction; step 2 shows the restriction toast; step 3 shows a soft glow around the star without a square; step 4 works as before.
Actual: matches the expected behavior.

Environment: macOS 26.5.2 (25F84), Telegram for macOS 13.1.0 (283357), Debug build from Xcode, Apple Silicon.

  • I confirm that I have tested the affected behavior and verified that it works properly, or verified the content and links for a documentation-only change.
@macosswift

Copy link
Copy Markdown
Collaborator

This branch has conflicts that must be resolved

@X-OrBit
X-OrBit force-pushed the feat/restricted-action-toasts branch from c7fa0a6 to 4fdd44b Compare October 25, 2026 16:11
@macosswift

Copy link
Copy Markdown
Collaborator

This branch has conflicts that must be resolved

@macosswift

Copy link
Copy Markdown
Collaborator

Please do not edit Localizable.strings — instead, add //TODOLANG and follow the instructions in AGENTS.md

@X-OrBit
X-OrBit force-pushed the feat/restricted-action-toasts branch from 4fdd44b to 2473860 Compare October 27, 2026 18:05
@X-OrBit
X-OrBit force-pushed the feat/restricted-action-toasts branch from 2473860 to 727d481 Compare October 27, 2026 18:15
@X-OrBit

X-OrBit commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: members who unlocked restrictions with boosts could not use reactions.

#83 ignored boosts when checking the permission (also broken on master). Now the check takes them into account, and the "cannot send reactions" toast shows only when reactions are really forbidden

@macosswift
macosswift merged commit f6636d7 into TelegramMessenger:master Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants