X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetReplyAjaxPage.java;h=82226e396a25573dee67badd78dd8cd5e9cff9f2;hb=445a0bc68d136a9f33e49ea4f47ab57e10d6a9c2;hp=c19bcba4169f4201724b2470ded7238efb7beb64;hpb=543601314f9213c4d4b5c8ae1177cdb2ab94a854;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java index c19bcba..82226e3 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.java @@ -65,7 +65,7 @@ public class GetReplyAjaxPage extends JsonPage { if ((reply == null) || (reply.getSone() == null)) { return createErrorJsonObject("invalid-reply-id"); } - return createSuccessJsonObject().put("reply", createJsonReply(reply, getCurrentSone(request.getToadletContext()))); + return createSuccessJsonObject().put("reply", createJsonReply(request, reply, getCurrentSone(request.getToadletContext()))); } /** @@ -89,7 +89,7 @@ public class GetReplyAjaxPage extends JsonPage { * The currently logged in Sone (to store in the template) * @return The JSON representation of the reply */ - private JsonObject createJsonReply(Reply reply, Sone currentSone) { + private JsonObject createJsonReply(Request request, Reply reply, Sone currentSone) { JsonObject jsonReply = new JsonObject(); jsonReply.put("id", reply.getId()); jsonReply.put("postId", reply.getPost().getId()); @@ -97,6 +97,7 @@ public class GetReplyAjaxPage extends JsonPage { jsonReply.put("time", reply.getTime()); StringWriter stringWriter = new StringWriter(); TemplateContext templateContext = webInterface.getTemplateContextFactory().createTemplateContext(); + templateContext.set("request", request); templateContext.set("reply", reply); templateContext.set("currentSone", currentSone); try {