From 384c61ceae3301c6bc92ee6f591ed9d186b15204 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 6 Apr 2019 21:53:13 +0300 Subject: Message properties --- src/main/java/com/juick/server/TelegramBotManager.java | 6 +++--- src/main/java/com/juick/server/www/controllers/AnythingFilter.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/juick/server') diff --git a/src/main/java/com/juick/server/TelegramBotManager.java b/src/main/java/com/juick/server/TelegramBotManager.java index 56b5b4f9..22864af8 100644 --- a/src/main/java/com/juick/server/TelegramBotManager.java +++ b/src/main/java/com/juick/server/TelegramBotManager.java @@ -268,7 +268,7 @@ public class TelegramBotManager implements NotificationListener { telegramPhoto.caption(msg); isSendTxt = false; } - bot.execute(telegramPhoto, new Callback() { + bot.execute(telegramPhoto, new Callback<>() { @Override public void onResponse(SendPhoto request, SendResponse response) { processTelegramResponse(chatId, response, source); @@ -286,7 +286,7 @@ public class TelegramBotManager implements NotificationListener { telegramMessage.replyToMessageId(replyTo); } telegramMessage.parseMode(ParseMode.Markdown).disableWebPagePreview(true); - bot.execute(telegramMessage, new Callback() { + bot.execute(telegramMessage, new Callback<>() { @Override public void onResponse(SendMessage request, SendResponse response) { processTelegramResponse(chatId, response, source); @@ -338,7 +338,7 @@ public class TelegramBotManager implements NotificationListener { String.format("You are subscribed to all Juick messages. " + "[Create or link](http://juick.com/signup?type=durov&hash=%s) " + "an existing Juick account to get your subscriptions and ability to post messages", hash)) - .parseMode(ParseMode.Markdown), new Callback() { + .parseMode(ParseMode.Markdown), new Callback<>() { @Override public void onResponse(SendMessage request, SendResponse response) { logger.info("got response: {}", response.message()); diff --git a/src/main/java/com/juick/server/www/controllers/AnythingFilter.java b/src/main/java/com/juick/server/www/controllers/AnythingFilter.java index 57b298eb..1f4cf75a 100644 --- a/src/main/java/com/juick/server/www/controllers/AnythingFilter.java +++ b/src/main/java/com/juick/server/www/controllers/AnythingFilter.java @@ -53,7 +53,7 @@ public class AnythingFilter extends OncePerRequestFilter { } com.juick.User user = userService.getUserByName(anything); if (user.getUid() > 0) { - ((HttpServletResponse)servletResponse).sendRedirect("/" + user.getName() + "/"); + servletResponse.sendRedirect("/" + user.getName() + "/"); } else { filterChain.doFilter(servletRequest, servletResponse); } -- cgit v1.2.3