aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/ws
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/ws')
-rw-r--r--src/main/java/com/juick/ws/XMPPConnection.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/juick/ws/XMPPConnection.java b/src/main/java/com/juick/ws/XMPPConnection.java
index 3122e715..65008906 100644
--- a/src/main/java/com/juick/ws/XMPPConnection.java
+++ b/src/main/java/com/juick/ws/XMPPConnection.java
@@ -113,8 +113,10 @@ public class XMPPConnection implements Runnable, Stream.StreamListener, Message.
String json = messageSerializer.serialize(jmsg).toString();
List<Integer> uids = SubscriptionsQueries.getSubscribedUsers(sql, jmsg.getUser().getUID(), jmsg.getMID())
.stream().map(User::getUID).collect(Collectors.toList());
-
+ logger.info(String.format("%d users subscribed to %d", uids.size(), jmsg.getUser().getUID()));
synchronized (ws.clients) {
+ Long legacycount = ws.clients.stream().filter(c -> c.legacy && c.allMessages).count();
+ logger.info(String.format("%d legacy users watched %d", legacycount, jmsg.getMID()));
ws.clients.stream().filter(c -> !c.legacy && uids.contains(c.visitor.getUID())).forEach(c -> {
try {
logger.info("sending message to " + c.visitor.getUID());
@@ -136,11 +138,14 @@ public class XMPPConnection implements Runnable, Stream.StreamListener, Message.
private void onJuickMessageReply(com.juick.Message jmsg) {
String json = messageSerializer.serialize(jmsg).toString();
-
+ logger.info("got reply: " + json);
List<Integer> threadUsers =
SubscriptionsQueries.getUsersSubscribedToComments(sql, jmsg.getMID(), jmsg.getUser().getUID())
.stream().map(User::getUID).collect(Collectors.toList());
+ logger.info(String.format("%d users subscribed to %d", threadUsers.size(), jmsg.getMID()));
synchronized (ws.clients) {
+ Long legacycount = ws.clients.stream().filter(c -> c.legacy && c.allReplies).count();
+ logger.info(String.format("%d legacy users watched %d", legacycount, jmsg.getMID()));
ws.clients.stream().filter(c -> !c.legacy && threadUsers.contains(c.visitor.getUID())).forEach(c -> {
try {
logger.info("sending reply to " + c.visitor.getUID());