aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-22 11:00:29 +0300
committerGravatar Vitaly Takmazov2018-02-22 11:00:29 +0300
commit48a66b5497c85b0e4bac7787168ca9c6e989d1ed (patch)
treecb28862eeda0f2a92eb3ee259bbc4f9c8f5b3031 /juick-www
parent0a47022611e9ade7b4cf04e8d2783e966610e136 (diff)
www: do not show reply button in banned user threads
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Messages.java2
-rw-r--r--juick-www/src/test/java/com/juick/www/WebAppTests.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/Messages.java b/juick-www/src/main/java/com/juick/www/controllers/Messages.java
index 3c938850..e74f7486 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/Messages.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/Messages.java
@@ -614,7 +614,7 @@ public class Messages {
boolean isMsgAuthor = visitor.getUid() == msg.getUser().getUid();
boolean isReplyAuthor = visitor.getUid() == reply.getUser().getUid();
reply.VisitorCanComment = isMsgAuthor || (!msg.ReadOnly
- && (isReplyAuthor || !userService.isInBLAny(visitor.getUid(), reply.getUser().getUid())));
+ && msg.VisitorCanComment && (isReplyAuthor || !userService.isInBLAny(visitor.getUid(), reply.getUser().getUid())));
}
}
diff --git a/juick-www/src/test/java/com/juick/www/WebAppTests.java b/juick-www/src/test/java/com/juick/www/WebAppTests.java
index d0c2f8ec..60e0fae6 100644
--- a/juick-www/src/test/java/com/juick/www/WebAppTests.java
+++ b/juick-www/src/test/java/com/juick/www/WebAppTests.java
@@ -221,6 +221,8 @@ public class WebAppTests {
assertThat(threadPage.querySelectorAll(".a-thread-comment").isEmpty(), equalTo(false));
privacyQueriesService.blacklistUser(freefd, ugnich);
assertThat(userService.isInBLAny(freefd.getUid(), ugnich.getUid()), equalTo(true));
+ int renhaId = userService.createUser("renha", "secret");
+ messagesService.createReply(mid, 0, renhaId, "people", null);
threadPage = webClient.getPage(String.format("http://localhost:8080/ugnich/%d", mid));
assertThat(threadPage.getWebResponse().getStatusCode(), equalTo(200));
assertThat(threadPage.querySelectorAll(".msg-comment-target").isEmpty(), equalTo(true));