From c11ceac5261662c3c20bfd497c4c89a1c9840e0a Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Tue, 11 Feb 2014 12:49:33 +0700 Subject: UserThread page title --- src/java/com/juick/http/www/UserThread.java | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 3357f65c..095612d7 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -33,7 +33,7 @@ import javax.servlet.http.HttpServletResponse; */ public class UserThread { - protected void doGetThread(Connection sql, HttpServletRequest request, HttpServletResponse response, com.juick.User user, int MID) throws ServletException, IOException { + protected void doGetThread(Connection sql, HttpServletRequest request, HttpServletResponse response, int MID) throws ServletException, IOException { com.juick.User visitor = Utils.getVisitorUser(sql, request, response); if (!MessagesQueries.canViewThread(sql, MID, visitor != null ? visitor.UID : 0)) { @@ -41,6 +41,8 @@ public class UserThread { return; } + com.juick.Message msg = MessagesQueries.getMessage(sql, MID); + boolean listview = false; String paramView = request.getParameter("view"); if (paramView != null) { @@ -56,16 +58,16 @@ public class UserThread { listview = true; } - String title = "@" + user.UName + " - #" + MID; + String title = msg.User.UName + ": " + msg.getTagsString(); response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); try { - PageTemplates.pageHead(out, title, ""); + PageTemplates.pageHead(out, title, ""); PageTemplates.pageNavigation(out, visitor, null); out.println("
"); - com.juick.Message msg = printMessage(out, sql, user, MID, visitor); + printMessage(out, sql, msg, visitor); printReplies(out, sql, msg, visitor, listview); out.println("
"); @@ -77,9 +79,7 @@ public class UserThread { } } - public static com.juick.Message printMessage(PrintWriter out, Connection sql, com.juick.User user, int mid, com.juick.User visitor) { - com.juick.Message msg = MessagesQueries.getMessage(sql, mid); - + public static com.juick.Message printMessage(PrintWriter out, Connection sql, com.juick.Message msg, com.juick.User visitor) { msg.VisitorCanComment = visitor != null; String tags = (msg.Tags.isEmpty()) ? "" : PageTemplates.formatTags(msg.Tags, msg.User); @@ -114,7 +114,7 @@ public class UserThread { } out.println("