projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don’t create cookies for link-enabled checking.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
IndexPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/IndexPage.java
b/src/main/java/net/pterodactylus/sone/web/IndexPage.java
index
7562526
..
a33072f
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/IndexPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/IndexPage.java
@@
-54,15
+54,22
@@
public class IndexPage extends SoneTemplatePage {
@Override
protected void processTemplate(Request request, Template template) throws RedirectException {
super.processTemplate(request, template);
@Override
protected void processTemplate(Request request, Template template) throws RedirectException {
super.processTemplate(request, template);
- Sone
s
one = getCurrentSone(request.getToadletContext());
+ Sone
currentS
one = getCurrentSone(request.getToadletContext());
List<Post> allPosts = new ArrayList<Post>();
List<Post> allPosts = new ArrayList<Post>();
- allPosts.addAll(
s
one.getPosts());
- for (String friendSoneId :
s
one.getFriends()) {
+ allPosts.addAll(
currentS
one.getPosts());
+ for (String friendSoneId :
currentS
one.getFriends()) {
if (!webInterface.getCore().hasSone(friendSoneId)) {
continue;
}
allPosts.addAll(webInterface.getCore().getSone(friendSoneId).getPosts());
}
if (!webInterface.getCore().hasSone(friendSoneId)) {
continue;
}
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);
}
Collections.sort(allPosts, Post.TIME_COMPARATOR);
template.set("posts", allPosts);
}