mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-25 17:41:37 +01:00
Add permission to bypass other's msgtoggle (#1955) @Xeyame
* Add permission to bypass other's msgtoggle Also thanks to MD for helping me with the code :) * Correct comment * Remove checking for console in favour of the already existing IUser check * Fix comments, again * Re add isIgnoreMsg() check Accidently removed it, sorry * Combine 2 checks
This commit is contained in:
parent
817caf299f
commit
7298393ec9
@ -121,8 +121,7 @@ public class SimpleMessageRecipient implements IMessageRecipient {
|
|||||||
User user = getUser(this);
|
User user = getUser(this);
|
||||||
boolean afk = false;
|
boolean afk = false;
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
if (user.isIgnoreMsg()
|
if (user.isIgnoreMsg() && sender instanceof IUser && !((IUser) sender).isAuthorized("essentials.msgtoggle.bypass")) { // Don't ignore console and senders with permission
|
||||||
&& !(sender instanceof Console)) { // Console must never be ignored.
|
|
||||||
return MessageResponse.MESSAGES_IGNORED;
|
return MessageResponse.MESSAGES_IGNORED;
|
||||||
}
|
}
|
||||||
afk = user.isAfk();
|
afk = user.isAfk();
|
||||||
|
Loading…
Reference in New Issue
Block a user