From f8ee2a5506f595114da7d232fa27efeaed66a829 Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Mon, 30 May 2016 16:45:46 -0700 Subject: [PATCH] Remove chat spy and admin bypass on login if player no longer has permission. Resolves #636 and #705. --- .../factions/listeners/FactionsPlayerListener.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index d601fd52..4609d640 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -86,6 +86,16 @@ public class FactionsPlayerListener implements Listener { } } + if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) { + me.setSpyingChat(false); + P.p.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName()); + } + + if (me.isAdminBypassing() && !player.hasPermission(Permission.BYPASS.node)) { + me.setIsAdminBypassing(false); + P.p.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName()); + } + // If they have the permission, don't let them autoleave. Bad inverted setter :\ me.setAutoLeave(!player.hasPermission(Permission.AUTO_LEAVE_BYPASS.node)); }