From bdf6c8ff1eb67d320684df025632ebf72966db37 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 29 Aug 2018 15:15:07 +0300 Subject: hide banned user messages, not disabled --- .../main/java/com/juick/service/MessagesServiceImpl.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java') 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(); } -- cgit v1.2.3