From 5ff660e5f3e73382781f854a0afc350d2ad6d626 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Sun, 11 Dec 2016 00:00:35 +0700 Subject: duplicated util method is removed --- .../src/main/java/com/juick/www/controllers/PMController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'juick-spring-www/src/main/java/com/juick/www') diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java index c3b37cf6..15a93684 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java @@ -9,6 +9,7 @@ import com.juick.service.TagService; import com.juick.service.UserService; import com.juick.util.MessageUtils; import com.juick.util.UserUtils; +import com.juick.util.WebUtils; import com.juick.www.WebApp; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +29,6 @@ import java.util.List; */ @Controller public class PMController { - private static final Logger logger = LoggerFactory.getLogger(PMController.class); @Inject @@ -64,7 +64,7 @@ public class PMController { User visitor = userService.getUserByName(name); List msgs = pmQueriesService.getLastPMSent(visitor.getUid()); - if (!UserUtils.checkUserNameValid(uname)) { + if (WebUtils.isNotUserName(uname)) { uname = ""; } context.put("title", title); @@ -87,7 +87,7 @@ public class PMController { uname = uname.substring(1); } int uid = 0; - if (UserUtils.checkUserNameValid(uname)) { + if (WebUtils.isUserName(uname)) { uid = userService.getUIDbyName(uname); } @@ -131,8 +131,7 @@ public class PMController { logger.warn("XMPP unavailable"); } return "redirect:/pm/sent"; - } else { - throw new HttpBadRequestException(); } + throw new HttpBadRequestException(); } } -- cgit v1.2.3