diff options
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/juick/http/www/Main.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/java/com/juick/http/www/Main.java b/src/main/java/com/juick/http/www/Main.java index ced7fb98..4c7f7e14 100644 --- a/src/main/java/com/juick/http/www/Main.java +++ b/src/main/java/com/juick/http/www/Main.java @@ -228,16 +228,21 @@ public class Main extends HttpServlet implements Stream.StreamListener { closeSqlSearch(); } else if (uri.matches("^/\\d+$")) { String strID = request.getRequestURI().substring(1); - int mid = 0; + int uid = 0; try { - mid = Integer.parseInt(strID); + uid = Integer.parseInt(strID); } catch (NumberFormatException e) { } - if (mid > 0) { - com.juick.User author = com.juick.server.MessagesQueries.getMessageAuthor(sql, mid); + if (uid > 0) { + com.juick.User author = UserQueries.getUserByUID(sql, uid); if (author != null) { - Utils.sendPermanentRedirect(response, "/" + author.UName + "/" + mid); - return; + if (author.UName != null) { + Utils.sendPermanentRedirect(response, "/" + author.UName); + return; + } else { + pagesUser.doGetBlog(sql, getSqlSearch(), request, response, author); + return; + } } } Errors.doGet404(sql, request, response); |