- protected void processTemplate(Request request, Template template) throws RedirectException {
- super.processTemplate(request, template);
- Sone sone = getCurrentSone(request.getToadletContext());
- List<Post> allPosts = new ArrayList<Post>();
- allPosts.addAll(sone.getPosts());
- for (Sone friendSone : sone.getFriends()) {
- allPosts.addAll(friendSone.getPosts());
+ protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
+ super.processTemplate(request, templateContext);
+ final Sone currentSone = getCurrentSone(request.getToadletContext());
+ Collection<Post> allPosts = new ArrayList<Post>();
+ allPosts.addAll(currentSone.getPosts());
+ for (String friendSoneId : currentSone.getFriends()) {
+ Optional<Sone> friendSone = webInterface.getCore().getSone(friendSoneId);
+ if (!friendSone.isPresent()) {
+ continue;
+ }
+ allPosts.addAll(friendSone.get().getPosts());