aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-10 14:14:49 +0300
committerGravatar Vitaly Takmazov2018-05-10 14:14:49 +0300
commit87773235eb18e5b711f1d1e09a017322229c623c (patch)
treed57254945423c6758c61a5483e28d635cfea827f
parent92d6239a05f2eefa69505e4e6570045290b00b94 (diff)
send message read events to websocket users
-rw-r--r--juick-server/src/main/java/com/juick/server/ServerManager.java5
-rw-r--r--juick-www/src/test/java/com/juick/WebAppTests.java1
2 files changed, 6 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ServerManager.java b/juick-server/src/main/java/com/juick/server/ServerManager.java
index b6e3afcf..92821feb 100644
--- a/juick-server/src/main/java/com/juick/server/ServerManager.java
+++ b/juick-server/src/main/java/com/juick/server/ServerManager.java
@@ -202,6 +202,11 @@ public class ServerManager implements NotificationListener {
serviceMessage.setUser(userTo);
serviceMessage.setMid(source.getMid());
serviceMessage.setUnread(false);
+ try {
+ u.session.sendMessage(new TextMessage(jsonMapper.writeValueAsString(serviceMessage)));
+ } catch (IOException e) {
+ logger.error("JSON error", e);
+ }
});
}
}
diff --git a/juick-www/src/test/java/com/juick/WebAppTests.java b/juick-www/src/test/java/com/juick/WebAppTests.java
index b625f7eb..4f6a5057 100644
--- a/juick-www/src/test/java/com/juick/WebAppTests.java
+++ b/juick-www/src/test/java/com/juick/WebAppTests.java
@@ -428,6 +428,7 @@ public class WebAppTests {
unreadThread.refresh();
assertThat(listener.getUnreadCounts().size(), is(2));
assertThat(listener.getUnreadCounts().get(1), is(0));
+ assertThat(freefd.isAnonymous(), is(false));
}
public static class EventListenerConfig {