X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FMoveProfileFieldAjaxPage.java;h=d4685e909fde61331957b2c93c5380c4d480867a;hp=092c1f74c3d5d143b15525b257776da14d33ebe0;hb=9e697ac643d11a2b7644a948732674eea195718a;hpb=1bc78b582ac59f2438002997f5780db4dcee0a2a diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/MoveProfileFieldAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/MoveProfileFieldAjaxPage.java index 092c1f7..d4685e9 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/MoveProfileFieldAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/MoveProfileFieldAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - MoveProfileFieldAjaxPage.java - Copyright © 2011 David Roden + * Sone - MoveProfileFieldAjaxPage.java - Copyright © 2011–2016 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,11 +17,13 @@ package net.pterodactylus.sone.web.ajax; +import javax.annotation.Nonnull; + import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Profile.Field; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.WebInterface; -import net.pterodactylus.util.json.JsonObject; +import net.pterodactylus.sone.web.page.FreenetRequest; /** * AJAX page that lets the user move a profile field up or down. @@ -30,7 +32,7 @@ import net.pterodactylus.util.json.JsonObject; * @see Profile#moveFieldDown(Field) * @author David ‘Bombe’ Roden */ -public class MoveProfileFieldAjaxPage extends JsonPage { +public class MoveProfileFieldAjaxPage extends LoggedInJsonPage { /** * Creates a new “move profile field” AJAX page. @@ -49,9 +51,9 @@ public class MoveProfileFieldAjaxPage extends JsonPage { /** * {@inheritDoc} */ + @Nonnull @Override - protected JsonObject createJsonObject(Request request) { - Sone currentSone = getCurrentSone(request.getToadletContext()); + protected JsonReturnObject createJsonObject(@Nonnull Sone currentSone, @Nonnull FreenetRequest request) { Profile profile = currentSone.getProfile(); String fieldId = request.getHttpRequest().getParam("field"); Field field = profile.getFieldById(fieldId);