aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'juick-spring-www/src/main/java/com/juick')
-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();
}
}