- protected JsonObject createJsonObject(Request request) {
- /* load Sones. */
- boolean loadAllSones = Boolean.parseBoolean(request.getHttpRequest().getParam("loadAllSones", "true"));
- Set<Sone> sones = new HashSet<Sone>(Collections.singleton(getCurrentSone(request.getToadletContext(), false)));
- if (loadAllSones) {
- sones.addAll(webInterface.getCore().getSones());
+ protected JsonReturnObject createJsonObject(FreenetRequest request) {
+ final Sone currentSone = getCurrentSoneWithoutCreatingSession(request.getToadletContext());
+ /* load Sones. always return the status of the current Sone. */
+ Set<Sone> sones = new HashSet<Sone>(Collections.singleton(getCurrentSoneWithoutCreatingSession(request.getToadletContext())));
+ String loadSoneIds = request.getHttpRequest().getParam("soneIds");
+ if (loadSoneIds.length() > 0) {
+ String[] soneIds = loadSoneIds.split(",");
+ for (String soneId : soneIds) {
+ /* just add it, we skip null further down. */
+ sones.add(webInterface.getCore().getSone(soneId).orNull());
+ }