From df2026741df009e60318fbe5bf3d6b5fa6ec1340 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 6 Oct 2011 22:15:24 +0200 Subject: [PATCH] Forward link filter requests to page implementation if it is supported. --- .../java/net/pterodactylus/sone/web/page/PageToadlet.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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; + } + } -- 2.7.4