aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/www/controllers
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-04-26 17:29:25 +0300
committerGravatar Vitaly Takmazov2019-04-26 17:29:25 +0300
commit1b5d8ba596869e7321dd7a0f4757d08306a4d9fd (patch)
tree5c2ec24ecd1f15fa01618d2938d55e3df6b01f76 /src/main/java/com/juick/server/www/controllers
parenta34350b62784d4332243ba40ffe928afd91f67d3 (diff)
Minimize SQL queries for banned users
Diffstat (limited to 'src/main/java/com/juick/server/www/controllers')
-rw-r--r--src/main/java/com/juick/server/www/controllers/MessagesWWW.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/www/controllers/MessagesWWW.java b/src/main/java/com/juick/server/www/controllers/MessagesWWW.java
index 41c95dcb..e1c1bed8 100644
--- a/src/main/java/com/juick/server/www/controllers/MessagesWWW.java
+++ b/src/main/java/com/juick/server/www/controllers/MessagesWWW.java
@@ -224,7 +224,7 @@ public class MessagesWWW {
if (paramTag == null) {
throw new HttpNotFoundException();
} else if (!paramTag.getName().equals(paramTagStr)) {
- String url = user.getName() + "/?tag=" + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8);
+ String url = user.getName() + "/?tag=" + URLEncoder.encode(paramTag.getName(), StandardCharsets.UTF_8);
return "redirect:/" + url;
}
}
@@ -510,7 +510,7 @@ public class MessagesWWW {
visitor.setAvatar(webApp.getAvatarWebPath(visitor));
Optional<com.juick.Message> message = messagesService.getMessage(mid);
- if (!message.isPresent() || message.get().getUser().isBanned()) {
+ if (message.isEmpty()) {
throw new HttpNotFoundException();
}