projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move Sone status into Sone.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
UnfollowSoneAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java
index
7e620ef
..
5d94d52
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java
@@
-19,6
+19,7
@@
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.WebInterface;
+import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.json.JsonObject;
/**
import net.pterodactylus.util.json.JsonObject;
/**
@@
-35,14
+36,14
@@
public class UnfollowSoneAjaxPage extends JsonPage {
* The Sone web interface
*/
public UnfollowSoneAjaxPage(WebInterface webInterface) {
* The Sone web interface
*/
public UnfollowSoneAjaxPage(WebInterface webInterface) {
- super("
ajax/
unfollowSone.ajax", webInterface);
+ super("unfollowSone.ajax", webInterface);
}
/**
* {@inheritDoc}
*/
@Override
}
/**
* {@inheritDoc}
*/
@Override
- protected JsonObject createJsonObject(Request request) {
+ protected JsonObject createJsonObject(
Freenet
Request request) {
String soneId = request.getHttpRequest().getParam("sone");
if (!webInterface.getCore().hasSone(soneId)) {
return createErrorJsonObject("invalid-sone-id");
String soneId = request.getHttpRequest().getParam("sone");
if (!webInterface.getCore().hasSone(soneId)) {
return createErrorJsonObject("invalid-sone-id");
@@
-51,9
+52,8
@@
public class UnfollowSoneAjaxPage extends JsonPage {
if (currentSone == null) {
return createErrorJsonObject("auth-required");
}
if (currentSone == null) {
return createErrorJsonObject("auth-required");
}
- currentSone.removeFriend(soneId);
- webInterface.getCore().saveSone(currentSone);
- return new JsonObject().put("success", true);
+ webInterface.getCore().unfollowSone(currentSone, soneId);
+ return createSuccessJsonObject();
}
}
}
}