X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FFreenetLinkParserContext.java;h=0712fc0b3533af9e839c89082e2869c0a8a3b989;hp=e524d912f9cd3f5efd6819d691a556e7571677d5;hb=f68dae6e6afab586e6031242960f76d641b48402;hpb=445a0bc68d136a9f33e49ea4f47ab57e10d6a9c2 diff --git a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParserContext.java b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParserContext.java index e524d91..0712fc0 100644 --- a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParserContext.java +++ b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParserContext.java @@ -18,6 +18,7 @@ package net.pterodactylus.sone.text; import net.pterodactylus.sone.data.Sone; +import net.pterodactylus.sone.web.page.Page.Request; /** * {@link ParserContext} implementation for the {@link FreenetLinkParser}. It @@ -28,20 +29,35 @@ import net.pterodactylus.sone.data.Sone; */ public class FreenetLinkParserContext implements ParserContext { + /** The request being processed. */ + private final Request request; + /** The posting Sone. */ private final Sone postingSone; /** * Creates a new link parser context. * + * @param request + * The request being processed * @param postingSone * The posting Sone */ - public FreenetLinkParserContext(Sone postingSone) { + public FreenetLinkParserContext(Request request, Sone postingSone) { + this.request = request; this.postingSone = postingSone; } /** + * Returns the request that is currently being processed. + * + * @return The request being processed + */ + public Request getRequest() { + return request; + } + + /** * Returns the Sone that provided the text that is being parsed. * * @return The posting Sone