mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-27 01:40:48 +08:00
Turn off socialspy on login if player doesn't have the permission.
This fixes the case where players had socialspy enabled, lost the permission for it (got demoted) and then someone had to manually check and disable it for them as described in #299.
This commit is contained in:
parent
1a701e69ca
commit
6fc19b92eb
@ -284,6 +284,11 @@ public class EssentialsPlayerListener implements Listener {
|
||||
user.getBase().setWalkSpeed(0.2f);
|
||||
}
|
||||
|
||||
if (user.isSocialSpyEnabled() && !user.isAuthorized("essentials.socialspy")) {
|
||||
user.setSocialSpyEnabled(false);
|
||||
ess.getLogger().log(Level.INFO, "Set socialspy to false for {0} because they had it enabled without permission.", user.getName());
|
||||
}
|
||||
|
||||
user.stopTransaction();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user