You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9dd68bc
Browse filesBrowse the repository at this point in the historyBrowse files
Respect protected content for photos in rich text messages
Photos inside a rich text message are opened through
ChatActivity.openArticlePhoto(), which uses PhotoViewer's page-block
mode (originally built for Instant View). That entry point passes no
MessageObject and dialogId 0, so the no-forwards check in page-block
mode (isPeerNoForwards(currentDialogId)) always passed: "Save to
Gallery", "Open in" and "Save GIF" stayed available and FLAG_SECURE
was never set, even in chats with protected content or private chats
with Disable Sharing on.
Resolve protection from the adapter's parent MessageObject (peer
no-forwards, per-message noforwards, revealed paid media) and use it
to compute allowShare, hide the Save to Gallery button, guard the save
action, and apply FLAG_SECURE. Instant View articles, whose parent is
the page itself, are unaffected.
Also reset the "Stop downloading" item in onPhotoShow() together with
the other menu items. It kept its initial VISIBLE state on the first
open, so checkHideMenuItem() left the "more" button visible; with
"Save to Gallery" hidden this showed an empty popup. checkProgress()
still shows the item when the media is actually loading.
Fixes https://bugs.telegram.org/c/64694
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments