/pidgin/main: ada9d85d4e38: libpurple3 compatibility: fix loadin...

Tomasz Wasilczyk twasilczyk at pidgin.im
Sun Apr 27 16:31:29 EDT 2014


Changeset: ada9d85d4e38729943ad01dc081a7d177aa62def
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-27 22:31 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/ada9d85d4e38

Description:

libpurple3 compatibility: fix loading GTalk and Facebook XMPP accounts

diffstat:

 ChangeLog           |   1 +
 libpurple/prpl.c    |  11 +++++++++++
 pidgin/gtkaccount.c |  11 +++++++++--
 pidgin/gtkutils.c   |   8 ++++++++
 4 files changed, 29 insertions(+), 2 deletions(-)

diffs (80 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ version 2.10.10 (?/?/?):
 
 	libpurple3 compatibility:
 	* Encrypted account passwords are preserved until the new one is set.
+	* Fix loading GTalk and Facebook XMPP accounts.
 
 	Windows-Specific Changes:
 	* Updates to dependencies:
diff --git a/libpurple/prpl.c b/libpurple/prpl.c
--- a/libpurple/prpl.c
+++ b/libpurple/prpl.c
@@ -626,6 +626,17 @@ purple_find_prpl(const char *id)
 
 	g_return_val_if_fail(id != NULL, NULL);
 
+	/* libpurple3 compatibility.
+	 * prpl-xmpp isn't used yet (it's prpl-jabber),
+	 * but may be used in the future.
+	 */
+	if (g_strcmp0(id, "prpl-xmpp") == 0 ||
+		g_strcmp0(id, "prpl-gtalk") == 0 ||
+		g_strcmp0(id, "prpl-facebook-xmpp") == 0)
+	{
+		id = "prpl-jabber";
+	}
+
 	for (l = purple_plugins_get_protocols(); l != NULL; l = l->next) {
 		plugin = (PurplePlugin *)l->data;
 
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -231,10 +231,17 @@ set_account_protocol_cb(GtkWidget *item,
 
 	if (dialog->plugin != NULL)
 	{
+		PurplePlugin *old_plugin = NULL;
+
 		dialog->prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(dialog->plugin);
 
-		g_free(dialog->protocol_id);
-		dialog->protocol_id = g_strdup(dialog->plugin->info->id);
+		if (dialog->protocol_id)
+			old_plugin = purple_find_prpl(dialog->protocol_id);
+
+		if (old_plugin != new_plugin) {
+			g_free(dialog->protocol_id);
+			dialog->protocol_id = g_strdup(dialog->plugin->info->id);
+		}
 	}
 
 	if (dialog->account != NULL)
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -712,6 +712,10 @@ create_protocols_menu(const char *defaul
 			if (pixbuf)
 				g_object_unref(pixbuf);
 
+			/* libpurple3 compatibility */
+			if (g_strcmp0(default_proto_id, "prpl-gtalk") == 0)
+				aop_menu->default_item = i;
+
 			gtalk_name = NULL;
 			i++;
 		}
@@ -731,6 +735,10 @@ create_protocols_menu(const char *defaul
 			if (pixbuf)
 				g_object_unref(pixbuf);
 
+			/* libpurple3 compatibility */
+			if (g_strcmp0(default_proto_id, "prpl-facebook-xmpp") == 0)
+				aop_menu->default_item = i;
+
 			facebook_name = NULL;
 			i++;
 		}



More information about the Commits mailing list