aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/TelegramBotManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/TelegramBotManager.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
index 50fe40e1..b4865dfb 100644
--- a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
+++ b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
@@ -366,9 +366,11 @@ public class TelegramBotManager implements NotificationListener {
com.juick.Message message = likeEvent.getMessage();
List<User> subscribers = likeEvent.getSubscribers();
logger.info("Like received in tg listener");
- telegramService.getTelegramIdentifiers(Collections.singletonList(message.getUser()))
- .forEach(c -> telegramNotify(c, String.format("%s recommends your [post](%s)",
- MessageUtils.getMarkdownUser(liker), formatUrl(message)), new com.juick.Message()));
+ if (!userService.isInBLAny(message.getUser().getUid(), liker.getUid())) {
+ telegramService.getTelegramIdentifiers(Collections.singletonList(message.getUser()))
+ .forEach(c -> telegramNotify(c, String.format("%s recommends your [post](%s)",
+ MessageUtils.getMarkdownUser(liker), formatUrl(message)), new com.juick.Message()));
+ }
telegramService.getTelegramIdentifiers(subscribers)
.forEach(c -> telegramNotify(c, String.format("%s recommends you someone's [post](%s)",
MessageUtils.getMarkdownUser(liker), formatUrl(message)), new com.juick.Message()));