aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-06-30 11:04:41 +0300
committerGravatar Vitaly Takmazov2016-06-30 11:04:41 +0300
commit614384564482c8a35a567dd092cf5674f853ebd3 (patch)
treea80a52a358f798fb041e30c592dddf21d9149cdc /src/main/java/com/juick
parent2e52796f2199e40deddff099830e40d1844f7793 (diff)
ws debug
Diffstat (limited to 'src/main/java/com/juick')
-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());