aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-08-29 15:15:07 +0300
committerGravatar Vitaly Takmazov2018-08-29 15:19:58 +0300
commitbdf6c8ff1eb67d320684df025632ebf72966db37 (patch)
treecb55d0edd18b3d820cd8a5ee99e7d4bc80258008 /juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
parent61a28570ca25ae789cca09736ddc427e172ac213 (diff)
hide banned user messages, not disabled
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java')
-rw-r--r--juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
index 125e4f63..913ee747 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -651,8 +651,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
.addValue("privacy", privacy)
.addValue("before", before);
- JuickUser juickUser = new JuickUser(userService.getUserByUID(uid).orElseThrow(IllegalStateException::new));
- if (!juickUser.isEnabled()) {
+ ;
+ if (userService.getUserByUID(uid).orElseThrow(IllegalStateException::new).isBanned()) {
throw new HttpNotFoundException();
}
@@ -674,8 +674,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
.addValue("privacy", privacy)
.addValue("before", before);
- JuickUser juickUser = new JuickUser(userService.getUserByUID(uid).orElseThrow(IllegalStateException::new));
- if (!juickUser.isEnabled()) {
+ if (userService.getUserByUID(uid).orElseThrow(IllegalStateException::new).isBanned()) {
throw new HttpNotFoundException();
}
@@ -697,8 +696,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
.addValue("privacy", privacy)
.addValue("daysback", daysback);
- JuickUser juickUser = new JuickUser(userService.getUserByUID(uid).orElseThrow(IllegalStateException::new));
- if (!juickUser.isEnabled()) {
+ if (userService.getUserByUID(uid).orElseThrow(IllegalStateException::new).isBanned()) {
throw new HttpNotFoundException();
}
@@ -720,8 +718,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
.addValue("privacy", privacy)
.addValue("before", before);
- JuickUser juickUser = new JuickUser(userService.getUserByUID(uid).orElseThrow(IllegalStateException::new));
- if (!juickUser.isEnabled()) {
+ if (userService.getUserByUID(uid).orElseThrow(IllegalStateException::new).isBanned()) {
throw new HttpNotFoundException();
}