aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-22 00:09:42 +0300
committerGravatar Vitaly Takmazov2018-02-22 00:27:16 +0300
commitdbc14ee4919b2f536a4afadba71ba8eb41290eb1 (patch)
tree6feab144941d0db72e1c243c1b0932f206d1b375 /juick-server/src/main/java
parent2a5753cb32dd184d66ee28d38881c9135f8526c4 (diff)
server: fix telegram reply to photo
Diffstat (limited to 'juick-server/src/main/java')
-rw-r--r--juick-server/src/main/java/com/juick/server/TelegramBotManager.java8
1 files changed, 6 insertions, 2 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 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<MessageEvent> {
} else {
Message replyMessage = message.replyToMessage();
if (replyMessage != null) {
- if (replyMessage.entities() != null) {
- Optional<MessageEntity> juickLink = Arrays.stream(replyMessage.entities())
+ MessageEntity [] entities = replyMessage.entities();
+ if (entities == null) {
+ entities = replyMessage.captionEntities();
+ }
+ if (entities != null) {
+ Optional<MessageEntity> juickLink = Arrays.stream(entities)
.filter(this::isJuickLink)
.findFirst();
if (juickLink.isPresent()) {