commit b358b973c9335674f23e7ed093db9e3319b4ab4a
parent 1e3b95e1d341111c0b3aeaac03aa059d7fc0d840
Author: Paul <paul@claws-mail.org>
Date: Mon, 24 Oct 2022 10:22:45 +0100
use GLib 2.66 when available
make things simpler for our future selves
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/plugins/fancy/fancy_web_extension.c b/src/plugins/fancy/fancy_web_extension.c
@@ -31,17 +31,25 @@ static gboolean web_page_send_request_cb(WebKitWebPage *web_page,
gboolean is_remote = TRUE;
gboolean should_block;
const char *request_uri = webkit_uri_request_get_uri(request);
+#if GLIB_CHECK_VERSION(2,66,0)
+ const char *scheme = g_uri_peek_scheme(request_uri);
+#else
gchar *scheme = g_uri_parse_scheme(request_uri);
-
+#endif
if (scheme == NULL)
return TRUE;
-
+#if GLIB_CHECK_VERSION(2,66,0)
+ if (g_ascii_strcasecmp(scheme, "cid") == 0 ||
+ g_ascii_strcasecmp(scheme, "file") == 0 ||
+ g_ascii_strcasecmp(scheme, "about") == 0)
+ is_remote = FALSE;
+#else
if (g_ascii_strcasecmp(scheme, "cid") == 0 ||
g_ascii_strcasecmp(scheme, "file") == 0 ||
g_ascii_strcasecmp(scheme, "about") == 0)
is_remote = FALSE;
g_free(scheme);
-
+#endif
if (is_remote)
should_block = !load_remote_content;
else