From: David ‘Bombe’ Roden Date: Thu, 30 Dec 2010 20:38:26 +0000 (+0100) Subject: Add all posts that have the current Sone as recipient. X-Git-Tag: beta-freefall-0.6.2-1~171 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=a4f8fd83799515684b86e2257b4fcc7a15cbe670 Add all posts that have the current Sone as recipient. --- 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); }