summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <ementalo@gmx.co.uk>2011-07-07 21:05:46 +0100
committerementalo <ementalo@gmx.co.uk>2011-07-07 21:05:46 +0100
commitdab37c7b5bfa718ef106694679a244eecb32d9af (patch)
tree4103fbcbb50e49a73a6c4e7fc013724276604ced
parentce14779d2bb76ca4df110d7f1d99e4da3ab03cb8 (diff)
parenta447bc7e66dc5779a991b10274fc6ae1f7c98369 (diff)
downloadEssentials-dab37c7b5bfa718ef106694679a244eecb32d9af.tar
Essentials-dab37c7b5bfa718ef106694679a244eecb32d9af.tar.gz
Essentials-dab37c7b5bfa718ef106694679a244eecb32d9af.tar.lz
Essentials-dab37c7b5bfa718ef106694679a244eecb32d9af.tar.xz
Essentials-dab37c7b5bfa718ef106694679a244eecb32d9af.zip
Merge branch 'master' of github.com:essentials/Essentials
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java4
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java8
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/IEssentialsXMPP.java4
3 files changed, 9 insertions, 7 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
index 84d207e8c..632505670 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
@@ -33,7 +33,9 @@ public class Commandxmpp extends EssentialsCommand
final String message = getFinalArg(args, 1);
final String senderName = sender instanceof Player ? ess.getUser(sender).getDisplayName() : Console.NAME;
sender.sendMessage("[" + senderName + ">" + address + "] " + message);
- EssentialsXMPP.getInstance().sendMessage(address, "[" + senderName + "] " + message);
+ if (!EssentialsXMPP.getInstance().sendMessage(address, "[" + senderName + "] " + message)) {
+ sender.sendMessage("§cError sending message.");
+ }
}
}
}
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
index 27988f11a..04fe1be94 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
@@ -103,15 +103,15 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
}
@Override
- public void sendMessage(final Player user, final String message)
+ public boolean sendMessage(final Player user, final String message)
{
- instance.xmpp.sendMessage(instance.users.getAddress(user.getName()), message);
+ return instance.xmpp.sendMessage(instance.users.getAddress(user.getName()), message);
}
@Override
- public void sendMessage(final String address, final String message)
+ public boolean sendMessage(final String address, final String message)
{
- instance.xmpp.sendMessage(address, message);
+ return instance.xmpp.sendMessage(address, message);
}
@Override
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/IEssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/IEssentialsXMPP.java
index c95520357..f5a944e2b 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/IEssentialsXMPP.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/IEssentialsXMPP.java
@@ -15,9 +15,9 @@ public interface IEssentialsXMPP
String getUserByAddress(final String address);
- void sendMessage(final Player user, final String message);
+ boolean sendMessage(final Player user, final String message);
- void sendMessage(final String address, final String message);
+ boolean sendMessage(final String address, final String message);
void setAddress(final Player user, final String address);