libpurple3 compatibility: fix loading GTalk and Facebook XMPP accounts release-2.x.y

Sun, 27 Apr 2014 22:31:20 +0200

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Sun, 27 Apr 2014 22:31:20 +0200
branch
release-2.x.y
changeset 35929
ada9d85d4e38
parent 35928
b68ad4695336
child 35934
d13ff446f400

libpurple3 compatibility: fix loading GTalk and Facebook XMPP accounts

ChangeLog file | annotate | diff | comparison | revisions
libpurple/prpl.c file | annotate | diff | comparison | revisions
pidgin/gtkaccount.c file | annotate | diff | comparison | revisions
pidgin/gtkutils.c file | annotate | diff | comparison | revisions
--- a/ChangeLog	Sun Apr 27 17:26:40 2014 +0200
+++ b/ChangeLog	Sun Apr 27 22:31:20 2014 +0200
@@ -13,6 +13,7 @@
 
 	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:
--- a/libpurple/prpl.c	Sun Apr 27 17:26:40 2014 +0200
+++ b/libpurple/prpl.c	Sun Apr 27 22:31:20 2014 +0200
@@ -626,6 +626,17 @@
 
 	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;
 
--- a/pidgin/gtkaccount.c	Sun Apr 27 17:26:40 2014 +0200
+++ b/pidgin/gtkaccount.c	Sun Apr 27 22:31:20 2014 +0200
@@ -231,10 +231,17 @@
 
 	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)
--- a/pidgin/gtkutils.c	Sun Apr 27 17:26:40 2014 +0200
+++ b/pidgin/gtkutils.c	Sun Apr 27 22:31:20 2014 +0200
@@ -712,6 +712,10 @@
 			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 @@
 			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++;
 		}

mercurial