projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'message-recipient'
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
DeleteReplyAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java
index
c996e52
..
7614de8
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/DeleteReplyAjaxPage.java
@@
-36,7
+36,7
@@
public class DeleteReplyAjaxPage extends JsonPage {
* The Sone web interface
*/
public DeleteReplyAjaxPage(WebInterface webInterface) {
* The Sone web interface
*/
public DeleteReplyAjaxPage(WebInterface webInterface) {
- super("
ajax/
deleteReply.ajax", webInterface);
+ super("deleteReply.ajax", webInterface);
}
//
}
//
@@
-49,19
+49,19
@@
public class DeleteReplyAjaxPage extends JsonPage {
@Override
protected JsonObject createJsonObject(Request request) {
String replyId = request.getHttpRequest().getParam("reply");
@Override
protected JsonObject createJsonObject(Request request) {
String replyId = request.getHttpRequest().getParam("reply");
- Reply reply = webInterface.
c
ore().getReply(replyId);
+ Reply reply = webInterface.
getC
ore().getReply(replyId);
Sone currentSone = getCurrentSone(request.getToadletContext());
if (reply == null) {
Sone currentSone = getCurrentSone(request.getToadletContext());
if (reply == null) {
- return
new JsonObject().put("success", false).put("error",
"invalid-reply-id");
+ return
createErrorJsonObject(
"invalid-reply-id");
}
if (currentSone == null) {
}
if (currentSone == null) {
- return
new JsonObject().put("success", false).put("error",
"auth-required");
+ return
createErrorJsonObject(
"auth-required");
}
if (!reply.getSone().equals(currentSone)) {
}
if (!reply.getSone().equals(currentSone)) {
- return
new JsonObject().put("success", false).put("error",
"not-authorized");
+ return
createErrorJsonObject(
"not-authorized");
}
}
- webInterface.
c
ore().deleteReply(reply);
- return
new JsonObject().put("success", true
);
+ webInterface.
getC
ore().deleteReply(reply);
+ return
createSuccessJsonObject(
);
}
}
}
}