From dbc14ee4919b2f536a4afadba71ba8eb41290eb1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 22 Feb 2018 00:09:42 +0300 Subject: server: fix telegram reply to photo --- .../src/main/java/com/juick/server/TelegramBotManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/java') 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 de54c3ce..5743a15e 100644 --- a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java +++ b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java @@ -165,8 +165,12 @@ public class TelegramBotManager implements ApplicationListener { } else { Message replyMessage = message.replyToMessage(); if (replyMessage != null) { - if (replyMessage.entities() != null) { - Optional juickLink = Arrays.stream(replyMessage.entities()) + MessageEntity [] entities = replyMessage.entities(); + if (entities == null) { + entities = replyMessage.captionEntities(); + } + if (entities != null) { + Optional juickLink = Arrays.stream(entities) .filter(this::isJuickLink) .findFirst(); if (juickLink.isPresent()) { -- cgit v1.2.3