Skip to content

Add essentials.chat.spy.exempt.block permission to fully block PMs to exempt players - #6603

Open
xBanD3l wants to merge 1 commit into
EssentialsX:2.xfrom
xBanD3l:socialspy-exempt-block-msg
Open

Add essentials.chat.spy.exempt.block permission to fully block PMs to exempt players#6603
xBanD3l wants to merge 1 commit into
EssentialsX:2.xfrom
xBanD3l:socialspy-exempt-block-msg

Conversation

@xBanD3l

@xBanD3l xBanD3l commented Aug 6, 2026

Copy link
Copy Markdown

Information

This PR closes #6599.

Details

Proposed feature:

Adds a new permission, essentials.chat.spy.exempt.block, that fully blocks incoming private messages to the holder, rather than only hiding them from /socialspy.

Currently, essentials.chat.spy.exempt only suppresses the socialspy broadcast copy of a private message sent to the exempt player — the message itself is still delivered to them. As raised in #6599, this doesn't fully protect the exempt player's privacy, since the sender's message content is still delivered and visible to the recipient (and, depending on setup, could still be observed/logged elsewhere).

Rather than changing the behavior of the existing essentials.chat.spy.exempt permission (which is widely used today purely to hide staff DMs from /socialspy, and changing it would break that behavior for existing servers), this adds a new, dedicated sub-permission that must be granted explicitly:

  • essentials.chat.spy.exempt.block: fully blocks incoming PMs to the holder. The sender sees the same "has messages disabled" feedback used for essentials.msgtoggle, so the block doesn't leak that it's related to socialspy exemption. No socialspy broadcast occurs for blocked messages (there's nothing to observe, since the message is never delivered), and holding this permission also implies exemption from /socialspy even if essentials.chat.spy.exempt isn't separately granted.
  • essentials.chat.spy.exempt behavior is completely unchanged — no existing server's permission setup is affected.

Environments tested:

OS: Windows 11
Java version: OpenJDK Temurin 25.0.3+9

  • Most recent Paper version (26.1.2, git-Paper-74)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Tested manually using ./gradlew build :runServer with LuckPerms installed, using three test players (A, B, C):

  • Granted essentials.chat.spy.exempt.block to player B, and essentials.socialspy to player C (spy).
  • Player A ran /msg B <message>: A received "PlayerB has messages disabled.", B received nothing, and C (spying) saw nothing.
  • Player B was still able to send messages to A normally (block only applies to incoming messages, not outgoing).
  • Regression-tested the existing essentials.chat.spy.exempt permission on its own (without .block): messages still deliver normally to the exempt player, and the socialspy broadcast is still suppressed, exactly as before this change.
  • Regression-tested a player with no exemption permissions at all: messages deliver normally and are visible to the social spy, confirming spying still works as expected for non-exempt players.

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.

Socialspy exempt shows messages sent TO exempt.

1 participant