summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src/com
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-06-16 16:05:48 +0100
committerKHobbits <rob@khobbits.co.uk>2012-06-16 16:05:48 +0100
commita764f8c929a8bf58c5a8d0fac6659b5ddbc554af (patch)
treea0104d9e4081e6386c17fa7803ff6e840ff4fd00 /EssentialsChat/src/com
parent5da886593b34b0fe69a4c23f68678d491d44a930 (diff)
downloadEssentials-a764f8c929a8bf58c5a8d0fac6659b5ddbc554af.tar
Essentials-a764f8c929a8bf58c5a8d0fac6659b5ddbc554af.tar.gz
Essentials-a764f8c929a8bf58c5a8d0fac6659b5ddbc554af.tar.lz
Essentials-a764f8c929a8bf58c5a8d0fac6659b5ddbc554af.tar.xz
Essentials-a764f8c929a8bf58c5a8d0fac6659b5ddbc554af.zip
Fix chat showing [spy] prefix when social spy was not required to see the message.
Fixes #2263
Diffstat (limited to 'EssentialsChat/src/com')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
index c67cb6a64..c65eb5a0e 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
@@ -127,23 +127,26 @@ public abstract class EssentialsChatPlayer implements Listener
}
if (!onlineUser.equals(sender))
{
- if (onlineUser.isAuthorized("essentials.chat.spy"))
- {
- type = type.concat(_("chatTypeSpy"));
- }
- else
- {
+ boolean abort = false;
final Location playerLoc = onlineUser.getLocation();
if (playerLoc.getWorld() != world)
{
- continue;
+ abort = true;
}
final double delta = playerLoc.distanceSquared(loc);
if (delta > chatStore.getRadius())
{
- continue;
+ abort = true;
}
- }
+ if (abort) {
+ if (onlineUser.isAuthorized("essentials.chat.spy"))
+ {
+ type = type.concat(_("chatTypeSpy"));
+ }
+ else
+ {
+ continue;
+ }
}
String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage());