summaryrefslogtreecommitdiffstats
path: root/EssentialsXMPP
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-10-16 20:59:39 +0100
committerKHobbits <rob@khobbits.co.uk>2013-10-16 21:05:33 +0100
commitff46b39f2b42abbe4ce8dc39e564f3dc71a2a104 (patch)
treed4438b241ea1b251105a2622aada79542c2f41ce /EssentialsXMPP
parentd6dfe5da65fdc9bda682615488f5dc9917c394b5 (diff)
downloadEssentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar.gz
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar.lz
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar.xz
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.zip
Extract CommandSender to CommandSource, this should prevent Ess user object leaks.
Diffstat (limited to 'EssentialsXMPP')
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java6
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
index e7dd01670..529b4a1c2 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.xmpp;
+import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console;
import com.earth2me.essentials.commands.EssentialsCommand;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,7 +16,7 @@ public class Commandxmpp extends EssentialsCommand
}
@Override
- protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException
+ protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException
{
if (args.length < 2)
{
@@ -31,7 +31,7 @@ public class Commandxmpp extends EssentialsCommand
else
{
final String message = getFinalArg(args, 1);
- final String senderName = sender instanceof Player ? ess.getUser(sender).getDisplayName() : Console.NAME;
+ final String senderName = sender.isPlayer() ? ess.getUser(sender.getPlayer()).getDisplayName() : Console.NAME;
sender.sendMessage("[" + senderName + ">" + address + "] " + message);
if (!EssentialsXMPP.getInstance().sendMessage(address, "[" + senderName + "] " + message))
{
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java
index 4f276c3b9..a3f8ee83e 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.xmpp;
+import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.commands.EssentialsCommand;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import java.util.List;
import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,7 +16,7 @@ public class Commandxmppspy extends EssentialsCommand
}
@Override
- protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException
+ protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException
{
if (args.length < 1)
{