From: David ‘Bombe’ Roden Date: Sat, 1 Apr 2017 08:00:46 +0000 (+0200) Subject: Use already existing variable for current Sone X-Git-Tag: 0.9.7^2~272 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9251c1197e6d200cde53a4249960f6bdd84b9b9a;p=Sone.git Use already existing variable for current Sone --- 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) {