*
* 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
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.TemplateException;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.TemplateException;
String replyId = request.getHttpRequest().getParam("reply");
Optional<PostReply> reply = webInterface.getCore().getPostReply(replyId);
if (!reply.isPresent()) {
String replyId = request.getHttpRequest().getParam("reply");
Optional<PostReply> reply = webInterface.getCore().getPostReply(replyId);
if (!reply.isPresent()) {
* The currently logged in Sone (to store in the template)
* @return The JSON representation of the reply
*/
* The currently logged in Sone (to store in the template)
* @return The JSON representation of the reply
*/
- private JsonObject createJsonReply(FreenetRequest request, PostReply reply, Sone currentSone) {
- JsonObject jsonReply = new JsonObject();
+ private JsonNode createJsonReply(FreenetRequest request, PostReply reply, Sone currentSone) {
+ ObjectNode jsonReply = new ObjectNode(instance);
jsonReply.put("id", reply.getId());
jsonReply.put("postId", reply.getPostId());
jsonReply.put("soneId", reply.getSone().getId());
jsonReply.put("id", reply.getId());
jsonReply.put("postId", reply.getPostId());
jsonReply.put("soneId", reply.getSone().getId());