Skip to content

feat: remove client and server-side message restrictions#28

Open
rhcp011235 wants to merge 2 commits intofagramdesktop:devfrom
rhcp011235:feature/unrestrict-clean
Open

feat: remove client and server-side message restrictions#28
rhcp011235 wants to merge 2 commits intofagramdesktop:devfrom
rhcp011235:feature/unrestrict-clean

Conversation

@rhcp011235
Copy link
Contributor

Summary

  • Forward from restricted channels — reroutes items from peers with NoForwards flag through SendExistingDocument/SendExistingPhoto or local file re-upload to bypass server-side CHAT_FORWARDS_RESTRICTED
  • Save/download media from restricted channelsforbidsSaving() no longer blocks when forbidsForward() is cleared
  • Copy text from restricted channelshasCopyRestriction() cleared via allowsForwarding() returning true
  • View-once mediaMediaFile::ttlSeconds() returns 0 and TTL photos/videos now display as normal media instead of showing "please view on your mobile" service message
  • Auto-delete timer (incoming)applyTTL() skips destruction for incoming messages, same pattern as anti-delete
  • Sponsored messages off by defaultdisable_ads setting default changed to true (still toggleable in FAgram settings)

Test plan

  • Forward a file from a channel with forwarding disabled — file arrives on other clients
  • Save/download media from a restricted channel — save button visible and functional
  • Copy text from a restricted channel — copy works normally
  • Open a view-once photo/video — displays normally, can be saved/forwarded
  • Chat with auto-delete timer — incoming messages persist after timer expires
  • Open a large channel — no sponsored messages shown by default

🤖 Generated with Claude Code

rhcp011235 and others added 2 commits March 14, 2026 13:28
- Forward messages from channels/chats/users with noforwards set by
  rerouting through SendExistingDocument/Photo or re-uploading from
  local cache to bypass server-side CHAT_FORWARDS_RESTRICTED
- Allow saving/downloading media from restricted channels (forbidsSaving)
- Allow copying text from restricted channels (hasCopyRestriction)
- Allow forwarding view-once media by suppressing ttlSeconds client-side
- Suppress auto-delete timer for incoming messages (same pattern as anti-delete)
- Disable sponsored messages by default (disable_ads defaults to true)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the gatekeeping in CheckMessageMedia() and CreateMedia() that
forced TTL photos and videos down the service-message path ("please
view on your mobile"). They now display as normal media, consistent
with the existing MediaFile::ttlSeconds() -> 0 patch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rhcp011235
Copy link
Contributor Author

Confirmed "Disappearing" photos and videos are visible from the desktop now and you can save them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant