aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-20 16:50:44 +0300
committerGravatar Vitaly Takmazov2018-04-20 16:50:44 +0300
commit0ef1fe7c8bd07844a1e3c90f88585546cb846241 (patch)
treebdcc467f3f50da662db8063e239db1c336f529ab /juick-server/src
parente4defa51ce6f124a76fc369c862c64553f7a0114 (diff)
server: fix telegram notifications
Diffstat (limited to 'juick-server/src')
-rw-r--r--juick-server/src/main/java/com/juick/server/TelegramBotManager.java8
1 files changed, 4 insertions, 4 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 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()));
}
}