aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/EmailManager.java
diff options
context:
space:
mode:
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));
}
}