changeset 29919:10c2702ecfff

merged with im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 04 Mar 2010 15:19:39 +0900
parents f5d753b3d01d (current diff) d4c887b0cb43 (diff)
children 2292d8896b0b
files pidgin/gtkblist.c
diffstat 4 files changed, 21 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/usermood.c	Wed Mar 03 01:13:44 2010 +0900
+++ b/libpurple/protocols/jabber/usermood.c	Thu Mar 04 15:19:39 2010 +0900
@@ -119,10 +119,6 @@
 	{NULL, NULL, NULL}
 };
 
-static PurpleMood empty_moods[] = {
-	{NULL, NULL, NULL}
-};
-
 static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) {
 	/* it doesn't make sense to have more than one item here, so let's just pick the first one */
 	xmlnode *item = xmlnode_get_child(items, "item");
@@ -268,6 +264,6 @@
 		return moods;
 	} else {
 		purple_debug_info("jabber", "get_moods: account doesn't support PEP\n");
-		return empty_moods;
+		return NULL;
 	}
 }
\ No newline at end of file
--- a/libpurple/prpl.h	Wed Mar 03 01:13:44 2010 +0900
+++ b/libpurple/prpl.h	Thu Mar 04 15:19:39 2010 +0900
@@ -572,7 +572,8 @@
 
 	/**
 	 * Returns an array of "PurpleMood"s, with the last one having
-	 * "mood" set to @c NULL.
+	 * "mood" set to @c NULL, or NULL if the account does not support setting
+	 * a mood.
 	 */
 	PurpleMood *(*get_moods)(PurpleAccount *account);
 };
--- a/pidgin/gtkblist.c	Wed Mar 03 01:13:44 2010 +0900
+++ b/pidgin/gtkblist.c	Thu Mar 04 15:19:39 2010 +0900
@@ -8022,8 +8022,10 @@
 		if (prpl_info &&
 		    (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) ||
 			 PURPLE_PLUGIN_HAS_ACTIONS(plugin))) {
-			if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) {
+			if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) &&
+			    prpl_info->get_moods(account) != NULL) {
 				GList *types;
+
 				for (types = purple_account_get_status_types(account);
 			     	types != NULL ; types = types->next) {
 					PurpleStatusType *type = types->data;
--- a/pidgin/win32/winpidgin.c	Wed Mar 03 01:13:44 2010 +0900
+++ b/pidgin/win32/winpidgin.c	Thu Mar 04 15:19:39 2010 +0900
@@ -97,7 +97,7 @@
 	return ret;
 }
 
-static void common_dll_prep(const TCHAR *path) {
+static BOOL common_dll_prep(const TCHAR *path) {
 	HMODULE hmod;
 	HKEY hkey;
 	struct _stat stat_buf;
@@ -110,7 +110,7 @@
 	if (_tstat(test_path, &stat_buf) != 0) {
 		printf("Unable to determine GTK+ path. \n"
 			"Assuming GTK+ is in the PATH.\n");
-		return;
+		return FALSE;
 	}
 
 
@@ -184,6 +184,8 @@
 				printf("SafeDllSearchMode is set to 0\n");
 		}/*end else*/
 	}
+
+	return TRUE;
 }
 
 static void portable_mode_dll_prep(const TCHAR *pidgin_dir) {
@@ -224,22 +226,23 @@
 	_tprintf(_T("%s\n"), path2);
 	_tputenv(path2);
 
-	/* set the GTK+ path to be \\path\to\GTK\bin */
-	_tcscat(path, _T("\\GTK\\bin"));
-
-	common_dll_prep(path);
+	if (!dll_prep(pidgin_dir)) {
+		/* set the GTK+ path to be \\path\to\GTK\bin */
+		_tcscat(path, _T("\\GTK\\bin"));
+		common_dll_prep(path);
+	}
 }
 
-static void dll_prep(const TCHAR *pidgin_dir) {
-	TCHAR gtk_path[MAX_PATH + 1];
-	gtk_path[0] = _T('\0');
+static BOOL dll_prep(const TCHAR *pidgin_dir) {
+	TCHAR path[MAX_PATH + 1];
+	path[0] = _T('\0');
 
 	if (*pidgin_dir) {
-		_sntprintf(gtk_path, sizeof(gtk_path) / sizeof(TCHAR), _T("%s\\Gtk\\bin"), pidgin_dir);
-		gtk_path[sizeof(gtk_path) / sizeof(TCHAR)] = _T('\0');
+		_sntprintf(path, sizeof(path) / sizeof(TCHAR), _T("%s\\Gtk\\bin"), pidgin_dir);
+		path[sizeof(path) / sizeof(TCHAR)] = _T('\0');
 	}
 
-	common_dll_prep(gtk_path);
+	return common_dll_prep(path);
 }
 
 static TCHAR* winpidgin_lcid_to_posix(LCID lcid) {