diff options
author | Vitaly Takmazov | 2017-09-30 10:43:43 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-09-30 10:43:43 +0300 |
commit | f658c873eb585b5cc6d6acb712c3af1081e347fa (patch) | |
tree | 04b0af338ad1d169c2a6cc176e8318552f381dc4 /juick-api/src/main | |
parent | 63453a0dab385cc140efe700834ab2d656359a27 (diff) |
telegram: add hint to unregistered user
Diffstat (limited to 'juick-api/src/main')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java | 8 |
1 files changed, 6 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 e14d226d..7dd82b9f 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 @@ -123,8 +123,12 @@ public class TelegramWebhook { String msgUrl = "http://juick.com/login?" + usersService.getHashByUID(user_from.getUid()); telegramBotManager.telegramNotify(message.from().id().longValue(), msg, msgUrl); } else if (text.toLowerCase().startsWith("/post ")) { - apiServer.processMessage(user_from, text.substring(6), attachment); - telegramBotManager.telegramNotify(message.from().id().longValue(), "message sent", null); + if (!user_from.isAnonymous()) { + apiServer.processMessage(user_from, text.substring(6), attachment); + telegramBotManager.telegramNotify(message.from().id().longValue(), "message sent", null); + } else { + telegramBotManager.telegramNotify(message.from().id().longValue(), "Please, /login to send messages", null); + } } else { telegramBotManager.telegramNotify(message.from().id().longValue(), "You can send messages and images to Juick with /post command", null); |