From: David ‘Bombe’ Roden Date: Thu, 6 Oct 2011 20:15:24 +0000 (+0200) Subject: Forward link filter requests to page implementation if it is supported. X-Git-Tag: 0.7.3^2~17^2~2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=df2026741df009e60318fbe5bf3d6b5fa6ec1340;p=Sone.git Forward link filter requests to page implementation if it is supported. --- diff --git a/src/main/java/net/pterodactylus/sone/web/page/PageToadlet.java b/src/main/java/net/pterodactylus/sone/web/page/PageToadlet.java index 2d1f35a..8245251 100644 --- a/src/main/java/net/pterodactylus/sone/web/page/PageToadlet.java +++ b/src/main/java/net/pterodactylus/sone/web/page/PageToadlet.java @@ -26,6 +26,7 @@ import net.pterodactylus.util.web.Page; import net.pterodactylus.util.web.Response; import freenet.client.HighLevelSimpleClient; import freenet.clients.http.LinkEnabledCallback; +import freenet.clients.http.LinkFilterExceptedToadlet; import freenet.clients.http.Toadlet; import freenet.clients.http.ToadletContext; import freenet.clients.http.ToadletContextClosedException; @@ -39,7 +40,7 @@ import freenet.support.io.Closer; * * @author David ‘Bombe’ Roden */ -public class PageToadlet extends Toadlet implements LinkEnabledCallback { +public class PageToadlet extends Toadlet implements LinkEnabledCallback, LinkFilterExceptedToadlet { /** The name of the menu item. */ private final String menuName; @@ -174,4 +175,16 @@ public class PageToadlet extends Toadlet implements LinkEnabledCallback { return true; } + // + // LINKFILTEREXCEPTEDTOADLET METHODS + // + + /** + * {@inheritDoc} + */ + @Override + public boolean isLinkExcepted(URI link) { + return (page instanceof FreenetPage) ? ((FreenetPage) page).isLinkExcepted(link) : false; + } + }