changeset 27411:e3fd06032c4b

merge of '3012bdc54e5d2391c4fe52e687e87903ecbf44cc' and 'b4d9ebda1400b338079c89d5b6ac444b73755128'
author Etan Reisner <pidgin@unreliablesource.net>
date Thu, 18 Jun 2009 23:04:07 +0000
parents 77177e6000e4 (diff) d3b6776186ce (current diff)
children c24032f5bfd7
files ChangeLog.API
diffstat 14 files changed, 74 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Thu Jun 18 22:21:59 2009 +0000
+++ b/ChangeLog.API	Thu Jun 18 23:04:07 2009 +0000
@@ -40,6 +40,7 @@
 		* purple_network_get_stun_ip
 		* purple_network_get_turn_ip
 		* purple_network_remove_port_mapping
+		* purple_plugins_get_search_paths
 		* purple_proxy_connect_udp
 		* purple_prpl_get_media_caps
 		* purple_prpl_got_account_actions
--- a/configure.ac	Thu Jun 18 22:21:59 2009 +0000
+++ b/configure.ac	Thu Jun 18 23:04:07 2009 +0000
@@ -1563,30 +1563,6 @@
 			AC_MSG_RESULT(no)
 		fi
 
-		if test "x$prefix" != "xNONE"; then
-			prefix=`eval echo $prefix`
-			PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$prefix"
-		fi
-
-		AC_ARG_WITH(perl-lib,
-		[AC_HELP_STRING([--with-perl-lib=[site|vendor|DIR]],
-			[specify where to install the Perl libraries for pidgin. Default is site.])],
-		[
-			if test "x$withval" = xsite; then
-				PERL_MM_PARAMS=""
-			elif test "x$withval" = xvendor; then
-				if test -z "`$perlpath -v | grep '5\.0'`"; then
-					PERL_MM_PARAMS="INSTALLDIRS=vendor"
-				else
-					PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
-				fi
-			else
-				PERL_MM_PARAMS="INSTALLDIRS=vendor PREFIX=$withval"
-			fi
-		])
-
-		AC_SUBST(PERL_MM_PARAMS)
-
 		AC_MSG_CHECKING(for DynaLoader.a)
 		DYNALOADER_A=`echo $PERL_LDFLAGS | $perlpath -pe 's/^(.* )*([[^ ]]*DynaLoader\.a).*/\2/'`
 
--- a/doc/notify-signals.dox	Thu Jun 18 22:21:59 2009 +0000
+++ b/doc/notify-signals.dox	Thu Jun 18 23:04:07 2009 +0000
@@ -30,7 +30,7 @@
                                       const char *url);
   @endsignalproto
   @signaldesc
-   Emitted before email notification is handed to the UI to display.
+   Emitted before notification of a single email is handed to the UI to display.
   @param subject   Subject of email being notified of.
   @param from      Who the email is from.
   @param to        Who the email is to.
--- a/libpurple/account.c	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/account.c	Thu Jun 18 23:04:07 2009 +0000
@@ -1132,29 +1132,32 @@
 purple_account_connect(PurpleAccount *account)
 {
 	PurplePlugin *prpl;
+	const char *password, *username;
 	PurplePluginProtocolInfo *prpl_info;
-	const char *password;
 
 	g_return_if_fail(account != NULL);
 
-	purple_debug_info("account", "Connecting to account %s\n",
-					purple_account_get_username(account));
-
-	if (!purple_account_get_enabled(account, purple_core_get_ui()))
+	username = purple_account_get_username(account);
+
+	if (!purple_account_get_enabled(account, purple_core_get_ui())) {
+		purple_debug_info("account",
+				  "Account %s not enabled, not connecting.\n",
+				  username);
 		return;
+	}
 
 	prpl = purple_find_prpl(purple_account_get_protocol_id(account));
-	if (prpl == NULL)
-	{
+	if (prpl == NULL) {
 		gchar *message;
 
-		message = g_strdup_printf(_("Missing protocol plugin for %s"),
-			purple_account_get_username(account));
+		message = g_strdup_printf(_("Missing protocol plugin for %s"), username);
 		purple_notify_error(account, _("Connection Error"), message, NULL);
 		g_free(message);
 		return;
 	}
 
+	purple_debug_info("account", "Connecting to account %s.\n", username);
+
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 	password = purple_account_get_password(account);
 	if ((password == NULL) &&
--- a/libpurple/buddyicon.h	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/buddyicon.h	Thu Jun 18 23:04:07 2009 +0000
@@ -189,8 +189,6 @@
  *                  takes ownership of and will free.
  * @param icon_len  The length of the icon data.
  * @param checksum  A protocol checksum from the prpl or @c NULL.
- *
- * @return The buddy icon set, or NULL if no icon was set.
  */
 void
 purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
--- a/libpurple/plugin.c	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/plugin.c	Thu Jun 18 23:04:07 2009 +0000
@@ -1222,6 +1222,12 @@
 	search_paths = g_list_append(search_paths, g_strdup(path));
 }
 
+GList *
+purple_plugins_get_search_paths()
+{
+	return search_paths;
+}
+
 void
 purple_plugins_unload_all(void)
 {
--- a/libpurple/plugin.h	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/plugin.h	Thu Jun 18 23:04:07 2009 +0000
@@ -512,6 +512,15 @@
 void purple_plugins_add_search_path(const char *path);
 
 /**
+ * Returns a list of plugin search paths.
+ *
+ * @constreturn A list of searched paths.
+ *
+ * @since 2.6.0
+ */
+GList *purple_plugins_get_search_paths(void);
+
+/**
  * Unloads all loaded plugins.
  */
 void purple_plugins_unload_all(void);
--- a/libpurple/plugins/perl/Makefile.am	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/plugins/perl/Makefile.am	Thu Jun 18 23:04:07 2009 +0000
@@ -99,7 +99,7 @@
 			${LN_S} -f $$srcloc/$$f $$f; \
 		done; \
 	fi
-	@cd common && $(perlpath) Makefile.PL $(PERL_MM_PARAMS)
+	@cd common && $(perlpath) Makefile.PL
 
 common/Makefile.PL: common/Makefile.PL.in $(top_builddir)/config.status
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
@@ -108,7 +108,7 @@
 	@for dir in $(perl_dirs); do \
 		cd $$dir && \
 		if [ ! -f Makefile ]; then \
-			$(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
+			$(perlpath) Makefile.PL; \
 		fi && \
 		($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 		 $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
@@ -164,6 +164,7 @@
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
+	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)\" \
 	$(DEBUG_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(PLUGIN_CFLAGS) \
--- a/libpurple/plugins/perl/common/Makefile.PL.in	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/plugins/perl/common/Makefile.PL.in	Thu Jun 18 23:04:07 2009 +0000
@@ -13,4 +13,16 @@
     'INC'               => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@',
     'OBJECT'            => '$(O_FILES)', # link all the C files too
 #    'OPTIMIZE'          => '-g', # For debugging
+    'INSTALLDIRS'          => 'vendor',
+    'INSTALL_BASE'         => '$(prefix)',
+    'INSTALLVENDORARCH'    => '$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/perl',
+    'INSTALLVENDORMAN3DIR' => '$(mandir)/man3',
+    'macro'                => {
+        'prefix'               => '@prefix@',
+        'exec_prefix'          => '@exec_prefix@',
+        'libdir'               => '@libdir@',
+        'mandir'               => '@mandir@',
+        'datarootdir'          => '@datarootdir@',
+        'PURPLE_MAJOR_VERSION' => '@PURPLE_MAJOR_VERSION@',
+    },
 );
--- a/libpurple/plugins/perl/perl.c	Thu Jun 18 22:21:59 2009 +0000
+++ b/libpurple/plugins/perl/perl.c	Thu Jun 18 23:04:07 2009 +0000
@@ -131,6 +131,7 @@
 #endif
 {
 	char *file = __FILE__;
+	GList *search_paths = purple_plugins_get_search_paths();
 	dXSUB_SYS;
 
 	/* This one allows dynamic loading of perl modules in perl scripts by
@@ -139,6 +140,17 @@
 #ifdef _WIN32
 	newXS("Win32CORE::bootstrap", boot_Win32CORE, file);
 #endif
+
+	while (search_paths != NULL) {
+		gchar *uselib;
+		const gchar *search_path = search_paths->data;
+		search_paths = g_list_next(search_paths);
+
+		uselib = g_strdup_printf("unshift @INC, \"%s%cperl\";",
+		                         search_path, G_DIR_SEPARATOR);
+		eval_pv(uselib, TRUE);
+		g_free(uselib);
+	}
 }
 
 static void
--- a/pidgin/gtkaccount.c	Thu Jun 18 22:21:59 2009 +0000
+++ b/pidgin/gtkaccount.c	Thu Jun 18 23:04:07 2009 +0000
@@ -1990,8 +1990,9 @@
 				/* This is for when set_account() is called for a single account */
 				const char *path;
 				path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon");
-				if (path != NULL)
+				if ((path != NULL) && (*path != '\0')) {
 					img = purple_imgstore_new_from_file(path);
+				}
 			}
 		} else {
 			img = purple_buddy_icons_find_account_icon(account);
--- a/pidgin/plugins/disco/Makefile.am	Thu Jun 18 22:21:59 2009 +0000
+++ b/pidgin/plugins/disco/Makefile.am	Thu Jun 18 23:04:07 2009 +0000
@@ -8,7 +8,9 @@
 
 xmppdisco_la_SOURCES = \
 	gtkdisco.c \
-	xmppdisco.c
+	xmppdisco.c \
+	gtkdisco.h \
+	xmppdisco.h
 
 xmppdisco_la_LIBADD = $(GTK_LIBS)
 
--- a/pidgin/plugins/perl/Makefile.am	Thu Jun 18 22:21:59 2009 +0000
+++ b/pidgin/plugins/perl/Makefile.am	Thu Jun 18 23:04:07 2009 +0000
@@ -44,7 +44,7 @@
 			${LN_S} -f $$srcloc/$$f $$f; \
 		done; \
 	fi
-	@cd common && $(perlpath) Makefile.PL $(PERL_MM_PARAMS)
+	@cd common && $(perlpath) Makefile.PL
 
 common/Makefile.PL: common/Makefile.PL.in $(top_builddir)/config.status
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
@@ -53,7 +53,7 @@
 	@for dir in $(perl_dirs); do \
 		cd $$dir && \
 		if [ ! -f Makefile ]; then \
-			$(perlpath) Makefile.PL $(PERL_MM_PARAMS); \
+			$(perlpath) Makefile.PL; \
 		fi && \
 		($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 		$(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
--- a/pidgin/plugins/perl/common/Makefile.PL.in	Thu Jun 18 22:21:59 2009 +0000
+++ b/pidgin/plugins/perl/common/Makefile.PL.in	Thu Jun 18 23:04:07 2009 +0000
@@ -13,4 +13,15 @@
     'OBJECT'        => '$(O_FILES)', # link all the C files too
     'TYPEMAPS'      => ["@top_srcdir@/libpurple/plugins/perl/common/typemap"],
 #    'OPTIMIZE'      => '-g', # For debugging.
+    'INSTALLDIRS'          => 'vendor',
+    'INSTALL_BASE'         => '$(prefix)',
+    'INSTALLVENDORARCH'    => '$(libdir)/pidgin/perl',
+    'INSTALLVENDORMAN3DIR' => '$(mandir)/man3',
+    'macro'                => {
+        'prefix'      => '@prefix@',
+        'exec_prefix' => '@exec_prefix@',
+        'libdir'      => '@libdir@',
+        'mandir'      => '@mandir@',
+        'datarootdir' => '@datarootdir@',
+    },
 );