From a4f8fd83799515684b86e2257b4fcc7a15cbe670 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 30 Dec 2010 21:38:26 +0100 Subject: [PATCH] Add all posts that have the current Sone as recipient. --- src/main/java/net/pterodactylus/sone/web/IndexPage.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/IndexPage.java b/src/main/java/net/pterodactylus/sone/web/IndexPage.java index 2d61cf3..a33072f 100644 --- a/src/main/java/net/pterodactylus/sone/web/IndexPage.java +++ b/src/main/java/net/pterodactylus/sone/web/IndexPage.java @@ -63,6 +63,13 @@ public class IndexPage extends SoneTemplatePage { } allPosts.addAll(webInterface.getCore().getSone(friendSoneId).getPosts()); } + for (Sone sone : webInterface.getCore().getSones()) { + for (Post post : sone.getPosts()) { + if (currentSone.equals(post.getRecipient()) && !allPosts.contains(post)) { + allPosts.add(post); + } + } + } Collections.sort(allPosts, Post.TIME_COMPARATOR); template.set("posts", allPosts); } -- 2.7.4