From 0ef1fe7c8bd07844a1e3c90f88585546cb846241 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 20 Apr 2018 16:50:44 +0300 Subject: server: fix telegram notifications --- .../src/main/java/com/juick/server/TelegramBotManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'juick-server/src') 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 31496407..bf7c9f39 100644 --- a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java +++ b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java @@ -329,7 +329,7 @@ public class TelegramBotManager implements NotificationListener { String msgUrl = formatUrl(jmsg); if (MessageUtils.isPM(jmsg)) { telegramService.getTelegramIdentifiers(Collections.singletonList(jmsg.getTo())) - .forEach(c -> telegramNotify(c, formatPost(jmsg, true), null)); + .forEach(c -> telegramNotify(c, formatPost(jmsg, true), jmsg)); } else if (MessageUtils.isReply(jmsg)) { com.juick.Message op = messagesService.getMessage(jmsg.getMid()); String fmsg = String.format("[%s](%s) %s", MSG_LINK, msgUrl, formatPost(jmsg, true)); @@ -356,10 +356,10 @@ public class TelegramBotManager implements NotificationListener { 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)),null)); + 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)), null)); + MessageUtils.getMarkdownUser(liker), formatUrl(message)), new com.juick.Message())); } @Override @@ -373,6 +373,6 @@ public class TelegramBotManager implements NotificationListener { User target = subscribeEvent.getToUser(); telegramService.getTelegramIdentifiers(Collections.singletonList(target)) .forEach(c -> telegramNotify(c, String.format("%s subscribed to your blog", - MessageUtils.getMarkdownUser(subscriber)), null)); + MessageUtils.getMarkdownUser(subscriber)), new com.juick.Message())); } } -- cgit v1.2.3