Skip to content

Allow owners to delegate no-forward bypass to specific admins#16

Merged
Rocket-Space merged 1 commit intomasterfrom
codex/fix-message-forwarding-behavior-for-owner
Feb 25, 2026
Merged

Allow owners to delegate no-forward bypass to specific admins#16
Rocket-Space merged 1 commit intomasterfrom
codex/fix-message-forwarding-behavior-for-owner

Conversation

@Rocket-Space
Copy link
Owner

Motivation

  • Make the "no forwards / protect content" bypass controllable per-admin instead of a single chat-wide flag so owners can delegate the ability to bypass noforwards to specific admins.
  • Preserve existing content-protection behavior for normal users while enabling owners to grant exceptions to trusted admins when needed.

Description

  • Persist the bypass per admin by changing the setting key to include userId and adding user-scoped helpers in MessagesController: isNoForwardsAdminBypassEnabled(chatId, userId), setNoForwardsAdminBypassEnabled(chatId, userId, enabled) and canBypassNoForwards(chatId); also added getNoForwardsAdminsBypassKey(chatId, userId) and adjusted checks to use current user id.
  • Update forwarding logic in ChatActivity so noforwards messages can be forwarded when the currently signed-in user has bypass rights by adding canBypassMessageNoForwards(...) and using it when computing canForwardMessage and hasSelectedNoforwardsMessage().
  • Remove the global owner-only "Override restriction" toggle from the group/channel type UI (ChatEditTypeActivity) to avoid exposing a chat-global bypass switch there.
  • Add a per-admin "Override restriction" toggle inside the admin rights editor (ChatRightsEditActivity) which is shown when the chat has noforwards and the editor is the chat owner, and persist that per-admin setting when admin rights are saved.
  • Key files changed: MessagesController.java, ChatActivity.java, ChatEditTypeActivity.java, ChatRightsEditActivity.java (UI and logic updates described above).

Testing

  • Attempted to compile with Gradle via ./gradlew :TMessagesProj:compileDebugJavaWithJavac -x lint to validate Java changes, but the build failed in this environment with a JDK/Gradle compatibility error: Unsupported class file major version 69 (environment limitation, not related to source changes).
  • Ran static code inspections and grep-based checks locally to ensure new helpers and references are wired in the modified files and that UI rows and toggle persistence logic are present; these checks matched the intended changes and did not report syntax errors in the edited sources.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Rocket-Space Rocket-Space merged commit 13bd2f8 into master Feb 25, 2026
1 check passed
Rocket-Space added a commit that referenced this pull request Feb 25, 2026
…rwarding-behavior-for-owner"

This reverts commit 13bd2f8, reversing
changes made to 584735a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant