diff options
Diffstat (limited to 'EssentialsXMPP/src')
3 files changed, 8 insertions, 4 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java index c4702b969..4a14ef730 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java @@ -22,5 +22,6 @@ public class Commandsetxmpp extends EssentialsCommand } EssentialsXMPP.getInstance().setAddress(user, args[0]); + user.sendMessage("XMPP address set to "+args[0]); } } diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java index 17e2bb136..861e8fc02 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java @@ -48,6 +48,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP xmpp = new XMPPManager(this); ess.addReloadListener(users); + ess.addReloadListener(xmpp); if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) { LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll")); diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java index 028c283b9..9ce9d72e0 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java @@ -26,6 +26,7 @@ import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Presence; +import org.jivesoftware.smack.util.StringUtils; public class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IConf @@ -84,7 +85,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager sendCommand(chat, message); break; default: - parent.getServer().broadcastMessage("<XMPP:" + chat.getParticipant() + "> " + message); + parent.getServer().broadcastMessage("<XMPP:" + StringUtils.parseBareAddress(chat.getParticipant()) + "> " + message); } } } @@ -138,7 +139,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager if (!createdLocally) { chat.addMessageListener(this); - final Chat old = chats.put(chat.getParticipant(), chat); + final Chat old = chats.put(StringUtils.parseBareAddress(chat.getParticipant()), chat); if (old != null) { old.removeMessageListener(this); @@ -259,7 +260,8 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager { for (Player p : matches) { - p.sendMessage("[" + chat.getParticipant() + ">" + p.getDisplayName() + "] " + message); + + p.sendMessage("[" +StringUtils.parseBareAddress(chat.getParticipant()) + ">" + p.getDisplayName() + "] " + message); } } } @@ -267,7 +269,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager private void sendCommand(final Chat chat, final String message) { - if (config.getStringList("op-users", new ArrayList<String>()).contains(chat.getParticipant())) + if (config.getStringList("op-users", new ArrayList<String>()).contains(StringUtils.parseBareAddress(chat.getParticipant()))) { final CraftServer craftServer = (CraftServer)parent.getServer(); if (craftServer != null) |