diff options
author | Vitaly Takmazov | 2018-04-12 00:41:57 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-04-12 00:41:57 +0300 |
commit | 97ffb90f765078aca3e4d6d173a6c93182d9165c (patch) | |
tree | 7e9c985d6b682522905c1ef63ec5cea63cbaf72a /juick-www/src | |
parent | e319dda17260334262603df9cdc18fe52d6c164b (diff) |
subscription mark all comments read
Diffstat (limited to 'juick-www/src')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/NewMessage.java | 2 | ||||
-rw-r--r-- | juick-www/src/test/java/com/juick/WebAppTests.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java index 6b97c7c4..c26d7c0c 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java @@ -148,7 +148,7 @@ public class NewMessage { String attachmentType = StringUtils.isNotEmpty(attachmentFName.toString()) ? attachmentFName.toString().substring(attachmentFName.toString().length() - 3) : null; int ridnew = messagesService.createReply(mid, rid, visitor, body, attachmentType); - subscriptionService.subscribeMessage(mid, visitor.getUid()); + subscriptionService.subscribeMessage(msg, visitor); Message xmsg = new Message(); xmsg.setFrom(botJid); diff --git a/juick-www/src/test/java/com/juick/WebAppTests.java b/juick-www/src/test/java/com/juick/WebAppTests.java index 37798d08..4f9f4cc1 100644 --- a/juick-www/src/test/java/com/juick/WebAppTests.java +++ b/juick-www/src/test/java/com/juick/WebAppTests.java @@ -336,10 +336,10 @@ public class WebAppTests { String discussionsUrl = "http://localhost:8080/?show=discuss"; HtmlPage discussions = webClient.getPage(discussionsUrl); assertThat(discussions.querySelectorAll("article").size(), is(0)); - subscriptionService.subscribeMessage(mid, freefd.getUid()); + subscriptionService.subscribeMessage(messagesService.getMessage(mid), freefd); discussions = (HtmlPage) discussions.refresh(); assertThat(discussions.querySelectorAll("article").size(), is(1)); - subscriptionService.subscribeMessage(midNew, freefd.getUid()); + subscriptionService.subscribeMessage(messagesService.getMessage(midNew), freefd); discussions = (HtmlPage) discussions.refresh(); assertThat(discussions.querySelectorAll("article").size(), is(2)); assertThat(discussions.querySelectorAll("article").get(0).getAttributes().getNamedItem("data-mid").getNodeValue(), is(String.valueOf(midNew))); @@ -353,7 +353,7 @@ public class WebAppTests { assertThat(discussionsOld.querySelectorAll("article").get(0).getAttributes().getNamedItem("data-mid").getNodeValue(), is(String.valueOf(midNew))); List<Integer> newMids = IntStream.rangeClosed(1, 19).map(i -> messagesService.createMessage(ugnich.getUid(), String.valueOf(i), null, null)).boxed().collect(Collectors.toList()); for (Integer m : newMids) { - subscriptionService.subscribeMessage(m, freefd.getUid()); + subscriptionService.subscribeMessage(messagesService.getMessage(m), freefd); } discussions = (HtmlPage) discussions.refresh(); assertThat(discussions.querySelectorAll("article").size(), is(20)); |