projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert “Sone unlocked” into EventBus-based event.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
CreateReplyAjaxPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java
b/src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java
index
9ed960f
..
20857f3
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/ajax/CreateReplyAjaxPage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - CreateReplyAjaxPage.java - Copyright © 2010 David Roden
+ * Sone - CreateReplyAjaxPage.java - Copyright © 2010
–2012
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
*
* 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
@@
-18,9
+18,11
@@
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.data.Post;
package net.pterodactylus.sone.web.ajax;
import net.pterodactylus.sone.data.Post;
-import net.pterodactylus.sone.data.Reply;
+import net.pterodactylus.sone.data.
Post
Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Sone;
+import net.pterodactylus.sone.text.TextFilter;
import net.pterodactylus.sone.web.WebInterface;
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;
/**
@@
-48,7
+50,7
@@
public class CreateReplyAjaxPage extends JsonPage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected JsonObject createJsonObject(Request request) {
+ protected JsonObject createJsonObject(
Freenet
Request request) {
String postId = request.getHttpRequest().getParam("post");
String text = request.getHttpRequest().getParam("text").trim();
String senderId = request.getHttpRequest().getParam("sender");
String postId = request.getHttpRequest().getParam("post");
String text = request.getHttpRequest().getParam("text").trim();
String senderId = request.getHttpRequest().getParam("sender");
@@
-60,7
+62,8
@@
public class CreateReplyAjaxPage extends JsonPage {
if ((post == null) || (post.getSone() == null)) {
return createErrorJsonObject("invalid-post-id");
}
if ((post == null) || (post.getSone() == null)) {
return createErrorJsonObject("invalid-post-id");
}
- Reply reply = webInterface.getCore().createReply(sender, post, text);
+ text = TextFilter.filter(request.getHttpRequest().getHeader("host"), text);
+ PostReply reply = webInterface.getCore().createReply(sender, post, text);
return createSuccessJsonObject().put("reply", reply.getId()).put("sone", sender.getId());
}
return createSuccessJsonObject().put("reply", reply.getId()).put("sone", sender.getId());
}