diff options
author | Vitaly Takmazov | 2017-12-18 12:14:56 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-12-18 12:14:56 +0300 |
commit | c6ac30f743167c5276569c7b95b586e9827a4e9e (patch) | |
tree | d893d81daaa666f3f888e193562e572785592c6c | |
parent | f84c1e7eac95ee3187885ddea80a4ff2085c0689 (diff) |
telegram: allow attachment without text, process /start
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java index 2ac805cd..dd4ebc06 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java +++ b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java @@ -121,8 +121,11 @@ public class TelegramWebhook { if (StringUtils.isBlank(text)) { text = message.caption(); } - if (StringUtils.isNotEmpty(text)) { - if (text.equalsIgnoreCase("/login")) { + if (StringUtils.isBlank(text)) { + text = StringUtils.EMPTY; + } + if (StringUtils.isNotEmpty(text) || StringUtils.isNotEmpty(attachment)) { + if (text.equalsIgnoreCase("/login") || text.equalsIgnoreCase("/start")) { String msgUrl = "http://juick.com/login?" + usersService.getHashByUID(user_from.getUid()); String msg = String.format("Hi, %s!\nTap to [log in](%s)", user_from.getName(), msgUrl); telegramBotManager.telegramNotify(message.from().id().longValue(), msg); |