aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/XMPPConnection.java')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/XMPPConnection.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
index 8dffd388..9e793a44 100644
--- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
+++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java
@@ -2,6 +2,7 @@ package com.juick.ws;
import com.juick.User;
import com.juick.json.MessageSerializer;
+import com.juick.server.MessagesQueries;
import com.juick.server.SubscriptionsQueries;
import com.juick.xmpp.JID;
import com.juick.xmpp.Message;
@@ -32,7 +33,7 @@ public class XMPPConnection implements Stream.StreamListener, Message.MessageLis
private static final Logger logger = LoggerFactory.getLogger(XMPPConnection.class);
@Inject
- JdbcTemplate sql;
+ JdbcTemplate jdbc;
ExecutorService service;
Stream xmpp;
String xmppPassword;
@@ -85,7 +86,9 @@ public class XMPPConnection implements Stream.StreamListener, Message.MessageLis
} else if (jmsg.getRID() == 0) {
onJuickMessagePost(jmsg);
} else {
- onJuickMessageReply(jmsg);
+ // to get quote
+ com.juick.Message reply = MessagesQueries.getReply(jdbc, jmsg.getMID(), jmsg.getRID());
+ onJuickMessageReply(reply);
}
}
}
@@ -108,7 +111,7 @@ public class XMPPConnection implements Stream.StreamListener, Message.MessageLis
private void onJuickMessagePost(com.juick.Message jmsg) {
String json = messageSerializer.serialize(jmsg).toString();
- List<Integer> uids = SubscriptionsQueries.getSubscribedUsers(sql, jmsg.getUser().getUID(), jmsg.getMID())
+ List<Integer> uids = SubscriptionsQueries.getSubscribedUsers(jdbc, jmsg.getUser().getUID(), jmsg.getMID())
.stream().map(User::getUID).collect(Collectors.toList());
synchronized (wsHandler.clients) {
wsHandler.clients.stream().filter(c ->
@@ -138,7 +141,7 @@ public class XMPPConnection implements Stream.StreamListener, Message.MessageLis
private void onJuickMessageReply(com.juick.Message jmsg) {
String json = messageSerializer.serialize(jmsg).toString();
List<Integer> threadUsers =
- SubscriptionsQueries.getUsersSubscribedToComments(sql, jmsg.getMID(), jmsg.getUser().getUID())
+ SubscriptionsQueries.getUsersSubscribedToComments(jdbc, jmsg.getMID(), jmsg.getUser().getUID())
.stream().map(User::getUID).collect(Collectors.toList());
synchronized (wsHandler.clients) {
wsHandler.clients.stream().filter(c ->