From 52a5187a49bde69f9fffb361c644a115e40fdf0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 5 Apr 2011 06:27:51 +0200 Subject: [PATCH] =?utf8?q?Add=20posts=20that=20are=20directed=20at=20a=20S?= =?utf8?q?one=20to=20=E2=80=9Cview=20Sone=E2=80=9D=20page.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/ViewSonePage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java index 758b93d..c7edc32 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java @@ -81,6 +81,8 @@ public class ViewSonePage extends SoneTemplatePage { Sone sone = webInterface.getCore().getSone(soneId, false); templateContext.set("sone", sone); List sonePosts = sone.getPosts(); + sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone)); + Collections.sort(sonePosts, Post.TIME_COMPARATOR); Pagination postPagination = new Pagination(sonePosts, 10).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("postPage"), 0)); templateContext.set("postPagination", postPagination); templateContext.set("posts", postPagination.getItems()); @@ -88,7 +90,7 @@ public class ViewSonePage extends SoneTemplatePage { final Map> repliedPosts = new HashMap>(); for (Reply reply : replies) { Post post = reply.getPost(); - if (repliedPosts.containsKey(post) || sone.equals(post.getSone())) { + if (repliedPosts.containsKey(post) || sone.equals(post.getSone()) || (sone.equals(post.getRecipient()))) { continue; } repliedPosts.put(post, webInterface.getCore().getReplies(post)); -- 2.7.4