aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-12-11 00:00:35 +0700
committerGravatar Vitaly Takmazov2016-12-11 18:24:37 +0300
commit5ff660e5f3e73382781f854a0afc350d2ad6d626 (patch)
treeab6ab4447c08d80dd3aa467daee3080b1b775395 /juick-spring-www/src/main/java
parentb1861f326a834865f1d700745dfb5f1b1596ba1f (diff)
duplicated util method is removed
Diffstat (limited to 'juick-spring-www/src/main/java')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java9
1 files changed, 4 insertions, 5 deletions
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<com.juick.Message> 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();
}
}