summaryrefslogtreecommitdiffstats
path: root/EssentialsXMPP
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsXMPP')
-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);