aboutsummaryrefslogtreecommitdiff
path: root/juick-commands/src/main/java/com/juick/command/PrivateMessage.java
diff options
context:
space:
mode:
authorGravatar Anatoliy Sablin2017-11-06 16:54:00 +0300
committerGravatar Anatoliy Sablin2017-11-06 16:54:00 +0300
commitbb2a47ea3c17f92c1d55d8b0d26cd26a880373d9 (patch)
tree29a8b9773671357948a1841c4a8663dd83b87e2d /juick-commands/src/main/java/com/juick/command/PrivateMessage.java
parent7fe4c65820d012d684405c56942b01da8e77bd23 (diff)
Moved to message listener.
Diffstat (limited to 'juick-commands/src/main/java/com/juick/command/PrivateMessage.java')
-rw-r--r--juick-commands/src/main/java/com/juick/command/PrivateMessage.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/juick-commands/src/main/java/com/juick/command/PrivateMessage.java b/juick-commands/src/main/java/com/juick/command/PrivateMessage.java
index 069bc367..6deaed45 100644
--- a/juick-commands/src/main/java/com/juick/command/PrivateMessage.java
+++ b/juick-commands/src/main/java/com/juick/command/PrivateMessage.java
@@ -1,7 +1,6 @@
package com.juick.command;
import com.juick.User;
-import com.juick.server.protocol.ProtocolListener;
import com.juick.service.PMQueriesService;
import com.juick.service.UserService;
import lombok.Getter;
@@ -46,7 +45,7 @@ public class PrivateMessage extends MultiArgsCommand {
}
@Override
- protected String execute(User sender, ProtocolListener protocolListener, String... arguments) {
+ protected String execute(User sender, MessageListener protocolListener, String... arguments) {
String addressee = arguments[0];
String body = arguments[1];
int ret;
@@ -80,12 +79,10 @@ public class PrivateMessage extends MultiArgsCommand {
jmsg.setUser(sender);
jmsg.setText(body);
msg.addExtension(jmsg);
- //TODO fix external dependency
- //router.sendStanza(msg);
+ protocolListener.sendStanza(msg);
msg.setTo(Jid.of(Integer.toString(addresseeUid), "ws.juick.com", null));
- //TODO fix external dependency
- //router.sendStanza(msg);
+ protocolListener.sendStanza(msg);
for (String userJid : jids_to) {
Message mm = new Message();
@@ -99,8 +96,7 @@ public class PrivateMessage extends MultiArgsCommand {
mm.setFrom(getJid());
mm.setBody("Private message from @" + sender.getName() + ":\n" + body);
}
- //TODO fix external dependency
- //xmpp.sendOut(ClientMessage.from(mm));
+ protocolListener.sendMessage(mm);
}
}