X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FCreatePostPage.java;h=58fd74ed258c38b944bafffa2485e0b0f3bd5255;hb=94041feaf2a141b8c75725301f06d7e4bc617a12;hp=44e0d219d1addd813da83eb65dbbb5068315875c;hpb=dcf921e95da3881c75f57323733273c96027822e;p=Sone.git 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 --- 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; +import net.pterodactylus.sone.data.Sone; 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) { - 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);