aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-14 12:43:16 +0300
committerGravatar Vitaly Takmazov2016-07-14 12:43:16 +0300
commitc079533ee4f02fa53ac429c89177a14b985dade3 (patch)
tree569dc09389b7951c0cfc0fd38ca1785420c98fb8 /juick-api/src/main/java/com/juick/api
parent01e4d74a2b2d47e3dbbfdf0d7e2119bd4e789321 (diff)
juick-api: telegram message text can be null
Diffstat (limited to 'juick-api/src/main/java/com/juick/api')
-rw-r--r--juick-api/src/main/java/com/juick/api/TelegramBotHook.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java
index f98bbc01..29b32af2 100644
--- a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java
+++ b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java
@@ -165,10 +165,15 @@ public class TelegramBotHook {
} else {
if (user_from.getUID() == 0) {
telegramSignupNotify(message.from().id().longValue(), UserQueries.getSignUpHashByTelegramID(jdbc, message.from().id().longValue(), username));
- } else if (message.text().equalsIgnoreCase("/login")) {
- String msg = String.format("Hi, %s!\nTap to log in", user_from.getUName());
- String msgUrl = "http://juick.com/login?" + UserQueries.getHashByUID(jdbc, user_from.getUID());
- telegramNotify(message.from().id().longValue(), msg, msgUrl);
+ } else {
+ String text = message.text();
+ if (text != null) {
+ if (text.equalsIgnoreCase("/login")) {
+ String msg = String.format("Hi, %s!\nTap to log in", user_from.getUName());
+ String msgUrl = "http://juick.com/login?" + UserQueries.getHashByUID(jdbc, user_from.getUID());
+ telegramNotify(message.from().id().longValue(), msg, msgUrl);
+ }
+ }
}
}
}