aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-12-18 12:14:56 +0300
committerGravatar Vitaly Takmazov2017-12-18 12:14:56 +0300
commitc6ac30f743167c5276569c7b95b586e9827a4e9e (patch)
treed893d81daaa666f3f888e193562e572785592c6c /juick-api/src/main/java/com/juick
parentf84c1e7eac95ee3187885ddea80a4ff2085c0689 (diff)
telegram: allow attachment without text, process /start
Diffstat (limited to 'juick-api/src/main/java/com/juick')
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java7
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);