projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Filter links when creating replies, too.
[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
012b9cf
..
7f719b7
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java
@@
-35,7
+35,7
@@
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);
}
/**
}
/**
@@
-44,16
+44,16
@@
public class UnfollowSoneAjaxPage extends JsonPage {
@Override
protected JsonObject createJsonObject(Request request) {
String soneId = request.getHttpRequest().getParam("sone");
@Override
protected JsonObject createJsonObject(Request request) {
String soneId = request.getHttpRequest().getParam("sone");
- Sone sone = webInterface.core().getSone(soneId);
- if (sone == null) {
- return new JsonObject().put("success", false).put("error", "invalid-sone-id");
+ if (!webInterface.getCore().hasSone(soneId)) {
+ return createErrorJsonObject("invalid-sone-id");
}
Sone currentSone = getCurrentSone(request.getToadletContext());
if (currentSone == null) {
}
Sone currentSone = getCurrentSone(request.getToadletContext());
if (currentSone == null) {
- return
new JsonObject().put("success", false).put("error",
"auth-required");
+ return
createErrorJsonObject(
"auth-required");
}
}
- currentSone.removeFriend(sone);
- return new JsonObject().put("success", true);
+ currentSone.removeFriend(soneId);
+ webInterface.getCore().touchConfiguration();
+ return createSuccessJsonObject();
}
}
}
}