aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/EmailManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-20 11:36:13 +0300
committerGravatar Vitaly Takmazov2018-03-20 11:36:13 +0300
commitbe91c5f5771282f2798cb687f915b0df44eaa59e (patch)
tree1d216e62851bf7cdc065a73d3a6d3d55e3137775 /juick-server/src/main/java/com/juick/server/EmailManager.java
parent4a1e9c4d8868ad1f14cd1c8df57db80bfbd897ce (diff)
jdbc: no more notifications from banned users
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/EmailManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/EmailManager.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/server/EmailManager.java b/juick-server/src/main/java/com/juick/server/EmailManager.java
index 8dd7e06e..83db3ac3 100644
--- a/juick-server/src/main/java/com/juick/server/EmailManager.java
+++ b/juick-server/src/main/java/com/juick/server/EmailManager.java
@@ -52,9 +52,10 @@ public class EmailManager implements ApplicationListener<MessageEvent> {
} else if (msg.getRid() > 0) {
Message originalMessage = messagesService.getMessage(msg.getMid());
String subject = String.format("New reply to %s", originalMessage.getUser().getName());
- subscriptionService.getUsersSubscribedToComments(msg.getMid(), msg.getUser().getUid())
- .forEach(user -> emailService.getEmails(user.getUid(), true)
- .forEach(email -> emailNotify(email, subject, msg)));
+ subscriptionService.getUsersSubscribedToComments(originalMessage, msg)
+ .stream().filter(user -> !userService.isInBLAny(user.getUid(), msg.getUser().getUid()))
+ .flatMap(user -> emailService.getEmails(user.getUid(), true).stream())
+ .forEach(email -> emailNotify(email, subject, msg));
}
}