projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow Sone, Post, and Reply creation only through the Core and its caches.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
CreatePostPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
b/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
index
44e0d21
..
58fd74e
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/CreatePostPage.java
@@
-18,6
+18,7
@@
package net.pterodactylus.sone.web;
import net.pterodactylus.sone.data.Post;
package net.pterodactylus.sone.web;
import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.template.Template;
/**
import net.pterodactylus.util.template.Template;
/**
@@
-51,7
+52,9
@@
public class CreatePostPage extends SoneTemplatePage {
super.processTemplate(request, template);
String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim();
if (text.length() != 0) {
super.processTemplate(request, template);
String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim();
if (text.length() != 0) {
- getCurrentSone(request.getToadletContext()).addPost(text);
+ Sone currentSone = getCurrentSone(request.getToadletContext());
+ Post post = webInterface.core().createPost(currentSone, System.currentTimeMillis(), text);
+ currentSone.addPost(post);
throw new RedirectException("index.html");
}
template.set("errorTextEmpty", true);
throw new RedirectException("index.html");
}
template.set("errorTextEmpty", true);