From 76d4f5c19b6da9ac330921bad4c27fb3228329c5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 11 Jan 2018 11:29:09 +0300 Subject: www: do not show reply button when any user is in bl --- juick-www/src/main/java/com/juick/www/controllers/Messages.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'juick-www/src/main/java/com/juick/www/controllers') 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 39e88b12..5a76256e 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 @@ -515,7 +515,7 @@ public class Messages { fillUserModel(model, user, visitor); if (visitor.getUid() > 0) { boolean isMsgAuthor = visitor.getUid() == msg.getUser().getUid(); - boolean isInBL = userService.isInBL(msg.getUser().getUid(), visitor.getUid()); + boolean isInBL = userService.isInBLAny(msg.getUser().getUid(), visitor.getUid()); msg.VisitorCanComment = isMsgAuthor || !(msg.ReadOnly || isInBL); } model.addAttribute("msg", msg); @@ -604,8 +604,8 @@ public class Messages { if (visitor.getUid() > 0) { boolean isMsgAuthor = visitor.getUid() == msg.getUser().getUid(); boolean isReplyAuthor = visitor.getUid() == reply.getUser().getUid(); - BooleanSupplier isInBL2 = () -> userService.checkBL(visitor.getUid(), blUIDs).contains(reply.getUser().getUid()); - reply.VisitorCanComment = isMsgAuthor || (!msg.ReadOnly && (isReplyAuthor || !isInBL2.getAsBoolean())); + reply.VisitorCanComment = isMsgAuthor || (!msg.ReadOnly + && (isReplyAuthor || !userService.isInBLAny(visitor.getUid(), reply.getUser().getUid()))); } } -- cgit v1.2.3