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