summaryrefslogtreecommitdiffstats
path: root/EssentialsXMPP/src
diff options
context:
space:
mode:
authorDerFlash <bte@freenet.de>2012-09-13 14:57:02 +0200
committerDerFlash <bte@freenet.de>2012-09-13 14:57:02 +0200
commit992e473b7286ddb3b2f3c1fd94244f427f83f8fd (patch)
tree63e5be9246bc594ada8080f447b1c2e1bc0eb9d8 /EssentialsXMPP/src
parent2fc16250a3164b3b22e1263c4e5f2097770819f4 (diff)
downloadEssentials-992e473b7286ddb3b2f3c1fd94244f427f83f8fd.tar
Essentials-992e473b7286ddb3b2f3c1fd94244f427f83f8fd.tar.gz
Essentials-992e473b7286ddb3b2f3c1fd94244f427f83f8fd.tar.lz
Essentials-992e473b7286ddb3b2f3c1fd94244f427f83f8fd.tar.xz
Essentials-992e473b7286ddb3b2f3c1fd94244f427f83f8fd.zip
Fix problems with async chat event not sending messages to xmpp chat spy
Diffstat (limited to 'EssentialsXMPP/src')
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java
index 17827c3c7..c0913e6a9 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import java.util.List;
+import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@@ -49,9 +50,18 @@ class EssentialsXMPPPlayerListener implements Listener
List<String> users = EssentialsXMPP.getInstance().getSpyUsers();
synchronized (users)
{
- for (String address : users)
+ for (final String address : users)
{
- EssentialsXMPP.getInstance().sendMessage(address, message);
+ Bukkit.getScheduler().scheduleSyncDelayedTask(ess, new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ EssentialsXMPP.getInstance().sendMessage(address, message);
+ }
+
+ });
+
}
}
}