[Commits] [SCM] claws branch, master, updated. 4.1.0-87-gc45dc1be7

jonathan at claws-mail.org jonathan at claws-mail.org
Thu Oct 20 04:30:23 UTC 2022


The branch, master has been updated
       via  c45dc1be79e0849b06d70e8861122457bc64cd4d (commit)
      from  5d798106f43254befbf3231bd0180ceaf51c32d3 (commit)

Summary of changes:
 src/plugins/fancy/Makefile.am    | 13 +++++++------
 src/plugins/fancy/fancy_viewer.c | 19 +++++++++++++++++++
 2 files changed, 26 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit c45dc1be79e0849b06d70e8861122457bc64cd4d
Author: Jonathan Boeing <jonathan at claws-mail.org>
Date:   Wed Oct 19 20:26:45 2022 -0700

    Don't load Fancy if the Web Extension isn't found

diff --git a/src/plugins/fancy/Makefile.am b/src/plugins/fancy/Makefile.am
index 9998a6b77..81341c218 100644
--- a/src/plugins/fancy/Makefile.am
+++ b/src/plugins/fancy/Makefile.am
@@ -16,7 +16,7 @@ webextensiondir = $(pkglibdir)/plugins/web_extensions
 
 if BUILD_FANCY_PLUGIN
 plugin_LTLIBRARIES = fancy.la
-webextension_LTLIBRARIES = libfancywebextension.la
+webextension_LTLIBRARIES = fancywebextension.la
 endif
 
 fancy_la_LDFLAGS = \
@@ -39,7 +39,8 @@ fancy_la_CPPFLAGS = \
 	$(WEBKIT_CFLAGS) \
 	$(LIBSOUP_GNOME_CFLAGS) \
 	$(CURL_CFLAGS) \
-	-DFANCY_WEB_EXTENSIONS_DIR=\""$(pkglibdir)/plugins/web_extensions"\"
+	-DFANCY_WEB_EXTENSIONS_DIR=\""$(pkglibdir)/plugins/web_extensions"\" \
+	-DFANCY_WEB_EXTENSION_FILE=\""fancywebextension"\"
 
 fancy_la_SOURCES = \
 	fancy_prefs.c \
@@ -47,9 +48,9 @@ fancy_la_SOURCES = \
 	fancy_viewer.c \
 	fancy_viewer.h
 
-libfancywebextension_la_SOURCES = fancy_web_extension.c
-libfancywebextension_la_CFLAGS = $(WEBKIT_CFLAGS)
-libfancywebextension_la_LIBADD = $(WEBKIT_LIBS)
-libfancywebextension_la_LDFLAGS = -module -avoid-version -no-undefined
+fancywebextension_la_SOURCES = fancy_web_extension.c
+fancywebextension_la_CFLAGS = $(WEBKIT_CFLAGS)
+fancywebextension_la_LIBADD = $(WEBKIT_LIBS)
+fancywebextension_la_LDFLAGS = -module -avoid-version -no-undefined
 
 .PHONY: test
diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
index b69fed533..48f312ec7 100644
--- a/src/plugins/fancy/fancy_viewer.c
+++ b/src/plugins/fancy/fancy_viewer.c
@@ -1267,6 +1267,25 @@ gint plugin_init(gchar **error)
 		}
 	g_free(directory);
 
+	gchar *web_ext_filename = g_strconcat(FANCY_WEB_EXTENSION_FILE,
+		".",
+		G_MODULE_SUFFIX,
+		NULL);
+	gchar *web_ext_file = g_build_path(G_DIR_SEPARATOR_S,
+		FANCY_WEB_EXTENSIONS_DIR,
+		web_ext_filename,
+		NULL);
+
+	if (!g_file_test(web_ext_file, G_FILE_TEST_EXISTS)) {
+		*error = g_strdup_printf(_("Failed to find the companion WebKit extension %s"), web_ext_file);
+		g_free(web_ext_filename);
+		g_free(web_ext_file);
+		return -1;
+	}
+
+	g_free(web_ext_filename);
+	g_free(web_ext_file);
+
 	webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(),
 		FANCY_WEB_EXTENSIONS_DIR);
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list