From 565b8f0b25c9215687ddd4c84f236e1d1696b93d Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Wed, 30 Jul 2014 17:53:19 +0700 Subject: formatTags rel=nofollow --- src/java/com/juick/http/www/UserThread.java | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src/java/com/juick/http/www/UserThread.java') 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 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 = "" + tags + ""; + tagsStr = "" + tagsStr + ""; } out.println("