Add an envionment variable for Pidgin plugin search path

Fri, 01 Oct 2021 01:02:39 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 01 Oct 2021 01:02:39 -0500
changeset 41064
c5ef99d267c3
parent 41063
8c240e88aef6
child 41065
b46de1b53654

Add an envionment variable for Pidgin plugin search path

Testing Done:
Ran Pidgin with `PIDGIN_PLUGIN_PATH` set to somewhere not in the default.

Reviewed at https://reviews.imfreedom.org/r/970/

pidgin/pidginapplication.c file | annotate | diff | comparison | revisions
--- a/pidgin/pidginapplication.c	Fri Oct 01 01:01:30 2021 -0500
+++ b/pidgin/pidginapplication.c	Fri Oct 01 01:02:39 2021 -0500
@@ -480,6 +480,7 @@
 	GError *error = NULL;
 	GList *active_accounts = NULL;
 	gchar *search_path = NULL;
+	const gchar *plugin_path = NULL;
 	gpointer handle = NULL;
 
 	G_APPLICATION_CLASS(pidgin_application_parent_class)->startup(application);
@@ -531,6 +532,19 @@
 		g_abort();
 	}
 
+	plugin_path = g_getenv("PIDGIN_PLUGIN_PATH");
+	if (plugin_path) {
+		gchar **paths;
+		gint i;
+
+		paths = g_strsplit(plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
+		for (i = 0; paths[i]; ++i) {
+			purple_plugins_add_search_path(paths[i]);
+		}
+
+		g_strfreev(paths);
+	}
+
 	if(g_getenv("PURPLE_PLUGINS_SKIP")) {
 		purple_debug_info("gtk",
 				"PURPLE_PLUGINS_SKIP environment variable "

mercurial