Hide Copy in text selection when Disable Sharing is on in private chats
dallo28 committed
- Author
- dallo28 · 61457974+dallo28@users.noreply.github.comOct 16, 2026 at 16:49
- Committer
- dallo28 · 61457974+dallo28@users.noreply.github.comOct 16, 2026 at 16:49
- Parents
- f32ffeec763f
Hide Copy in text selection when Disable Sharing is on in private chats ChatActivity's text-selection canCopy() only honoured the peer-level no-forwards flag for groups/channels (dialogId < 0). The private-chat "Disable Sharing" setting lives on UserFull (noforwards_my_enabled / noforwards_peer_enabled), so long-pressing a message in such a chat still offered Copy and Select All for the selected text. Use ChatActivity.isPeerNoForwards(), which covers both chats and users and is already used by the message context menu, limited to cloud chats so secret chats behave exactly as before. Also guard TextSelectionHelper.copyText() with canCopy() as a defensive check. Fixes https://bugs.telegram.org/c/66665 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed+2−2