EssentialsX

EssentialsX

2M Downloads

[Compatibility] Chat priorities with ChatControl

MithrandirCraft opened this issue ยท 3 comments

commented

Information

Full output of /ess version:

[17:20:32 INFO]: Server version: 1.13.2-R0.1-SNAPSHOT git-Spigot-1a3504a-a46fdbc (MC: 1.13.2)
[17:20:32 INFO]: EssentialsX version: 2.17.0.0
[17:20:32 INFO]: LuckPerms version: 4.3.58
[17:20:32 INFO]: Vault version: 1.7.1-b91
[17:20:32 INFO]: EssentialsXChat version: 2.17.0.0
[17:20:32 INFO]: EssentialsXAntiBuild version: 2.17.0.0
[17:20:32 INFO]: EssentialsXSpawn version: 2.17.0.0

Server log: No way I'm doing that. Sorry. This shouldn't be necesary, and I haven't seen any other developer asking for it before.

EssentialsX config: https://gist.github.com/MithrandirCraft/2e32767935050d1e06682eb98cf2ea87

Details

Description
You can read ignored (with essentialsX) player's messages in chat, if you are also using ChatControlPro's chat formatter.

Steps to reproduce

  1. Install on a clean spigot server: EssentialsX & ChatControlPro
  2. Make sure you are using chat formatting with ChatControlPro
  3. Try to /ignore someone. ChatControl's chat format has higher priority over ignoring.

Expected behavior
Ignore should make messages from other players, even if ChatControlPro formats the chat. Ignoring should have higher priority.

commented

Please fill out the entire issue template, and also properly explain the issue. Assume we know nothing about this other plugin.

commented

Thank you for keeping the ticket open. I've updated the ticket.

commented

This issue is entirely on ChatControl's end. EssentialsX does exactly what it should according to the API by selectively removing recipients from chat events, and ChatControl does not appear to respect any plugin that does this. We will not change EssentialsX's behaviour and risk breaking dozens of other plugins to accommodate for flaws in one "premium" chat plugin we have no access to.


Each chat message event has a set of "recipients" which plugins can modify, which starts off as containing all players on the server. If the chat event passes through all plugins without being cancelled, CraftBukkit then sends the chat message to the players in that set, as can be seen in this CraftBukkit patch.

EssentialsX hides chat messages by ignored users by removing any player from the recipients if they have ignored the message sender here:

final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext()) {
final User u = ess.getUser(it.next());
if (u.isIgnoredPlayer(user)) {
it.remove();
}
}

This is done on LOWEST priority, which (contrary to what you might expect) means we do this as soon as possible and any plugins listening to AsyncPlayerChatEvent on LOW/NORMAL/HIGH/HIGHEST/MONITOR priority will be able to see who has been removed.

However, ChatControl causes the event's set of recipients to be ignored. Whether this is due to ChatControl cancelling the event and sending the message itself or it overwriting the list is unknown. kangarko/ChatControl-Pro#1427 demonstrates that zero consideration has been taken towards respecting this list or even looking into what EssentialsX or other ignore plugins do - if this had been considered, it would be plainly obvious that all they need to to is check the recipients list.

Side note: ChatControl does seem to have an option to make it always check EssentialsX's ignore lists. This likely achieves what you want, but is unnecessary effort, because EssentialsX already does this filtering and all this does is make ChatControl redo the same filtering.