summaryrefslogtreecommitdiffstats
path: root/EssentialsXMPP/src
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-07 21:25:15 +0200
committersnowleo <schneeleo@gmail.com>2011-07-07 21:25:15 +0200
commita447bc7e66dc5779a991b10274fc6ae1f7c98369 (patch)
treeca94154f804f62931883820bbf0988c91692c30f /EssentialsXMPP/src
parent4d3e8332a8e1a3b632419f242bfbec6b33457536 (diff)
downloadEssentials-a447bc7e66dc5779a991b10274fc6ae1f7c98369.tar
Essentials-a447bc7e66dc5779a991b10274fc6ae1f7c98369.tar.gz
Essentials-a447bc7e66dc5779a991b10274fc6ae1f7c98369.tar.lz
Essentials-a447bc7e66dc5779a991b10274fc6ae1f7c98369.tar.xz
Essentials-a447bc7e66dc5779a991b10274fc6ae1f7c98369.zip
Return boolean on sendMessage (XMPP)
Diffstat (limited to 'EssentialsXMPP/src')
-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);