aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-api/src/main/java')
-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);