From 9251c1197e6d200cde53a4249960f6bdd84b9b9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 1 Apr 2017 10:00:46 +0200 Subject: [PATCH] Use already existing variable for current Sone --- .../java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java index 8e0ac1e..45c1cee 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -76,7 +76,7 @@ public class GetStatusAjaxPage extends JsonPage { protected JsonReturnObject createJsonObject(FreenetRequest request) { final Sone currentSone = getCurrentSoneWithoutCreatingSession(request.getToadletContext()); /* load Sones. always return the status of the current Sone. */ - Set sones = new HashSet(Collections.singleton(getCurrentSoneWithoutCreatingSession(request.getToadletContext()))); + Set sones = new HashSet(Collections.singleton(currentSone)); String loadSoneIds = request.getHttpRequest().getParam("soneIds"); if (loadSoneIds.length() > 0) { String[] soneIds = loadSoneIds.split(","); @@ -96,7 +96,7 @@ public class GetStatusAjaxPage extends JsonPage { List notifications = new ArrayList(webInterface.getNotifications(currentSone)); Collections.sort(notifications, Notification.CREATED_TIME_SORTER); /* load new posts. */ - Collection newPosts = webInterface.getNewPosts(getCurrentSoneWithoutCreatingSession(request.getToadletContext())); + Collection newPosts = webInterface.getNewPosts(currentSone); ArrayNode jsonPosts = new ArrayNode(instance); for (Post post : newPosts) { @@ -108,7 +108,7 @@ public class GetStatusAjaxPage extends JsonPage { jsonPosts.add(jsonPost); } /* load new replies. */ - Collection newReplies = webInterface.getNewReplies(getCurrentSoneWithoutCreatingSession(request.getToadletContext())); + Collection newReplies = webInterface.getNewReplies(currentSone); ArrayNode jsonReplies = new ArrayNode(instance); for (PostReply reply : newReplies) { -- 2.7.4