Get the notifications from the web interface.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / JsonPage.java
index 27fa081..b9bdc77 100644 (file)
@@ -112,12 +112,7 @@ public abstract class JsonPage implements Page {
                if (soneId == null) {
                        return null;
                }
-               for (Sone sone : webInterface.getCore().getSones()) {
-                       if (sone.getId().equals(soneId)) {
-                               return sone;
-                       }
-               }
-               return null;
+               return webInterface.getCore().getLocalSone(soneId, false);
        }
 
        //
@@ -150,6 +145,15 @@ public abstract class JsonPage implements Page {
        //
 
        /**
+        * Creates a success reply.
+        *
+        * @return A reply signaling success
+        */
+       protected JsonObject createSuccessJsonObject() {
+               return new JsonObject().put("success", true);
+       }
+
+       /**
         * Creates an error reply.
         *
         * @param error