diff options
author | Ugnich Anton | 2014-07-30 17:53:19 +0700 |
---|---|---|
committer | Ugnich Anton | 2014-07-30 17:53:19 +0700 |
commit | 565b8f0b25c9215687ddd4c84f236e1d1696b93d (patch) | |
tree | f9c7a176a56791b8e007ff9dcb877666c0fc468c /src/java/com/juick/http/www/UserThread.java | |
parent | c4eebb74f520c122800c000c2329d3b6b7520c65 (diff) |
formatTags rel=nofollow
Diffstat (limited to 'src/java/com/juick/http/www/UserThread.java')
-rw-r--r-- | src/java/com/juick/http/www/UserThread.java | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 46242e2b..1dd1df69 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -98,24 +98,14 @@ public class UserThread { 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, null); //msg.User); + ArrayList<com.juick.Tag> tags = MessagesQueries.getMessageTags(sql, msg.MID); + String tagsStr = PageTemplates.formatTags(tags); if (msg.ReadOnly) { - tags += " *readonly"; + tagsStr += " *readonly"; msg.VisitorCanComment = false; } - switch (msg.Privacy) { - case 2: - tags += " *public"; - break; - case -1: - tags += " *friends"; - break; - case -2: - tags += " *friends"; - break; - case -3: - tags += " *private"; - break; + if (msg.Privacy < 0) { + tagsStr += " *friends"; } String txt; @@ -126,7 +116,7 @@ public class UserThread { } if (!tags.isEmpty()) { - tags = "<span class=\"msg-tags\">" + tags + "</span>"; + tagsStr = "<span class=\"msg-tags\">" + tagsStr + "</span>"; } out.println("<ul>"); @@ -134,7 +124,7 @@ public class UserThread { out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\" alt=\"" + msg.User.UName + "\"/></a></div>"); out.println(" <div class=\"msg-cont\">"); out.println(" <div class=\"msg-menu\"><a href=\"#\" onclick=\"showMessageLinksDialog(" + msg.MID + "); return false\"></a></div>"); - out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:" + tags + "</div>"); + out.println(" <div class=\"msg-header\"><a href=\"/" + msg.User.UName + "/\">@" + msg.User.UName + "</a>:" + tagsStr + "</div>"); out.println(" <div class=\"msg-ts\">" + PageTemplates.formatJSLocalTime(msg.TimestampString) + "</div>"); out.println(" <div class=\"msg-txt\">" + txt + "</div>"); |