pidgin: ceb8d10d: The MSN AddressBook can contain contacts...

qulogic at pidgin.im qulogic at pidgin.im
Sun Feb 1 04:20:32 EST 2009


-----------------------------------------------------------------
Revision: ceb8d10d8cb2ffe6180c24cbd3e5ed8dbbb559b6
Ancestor: 96db74f0ccbe2a283893e33f0f7bff5a827f48d9
Author: qulogic at pidgin.im
Date: 2009-01-31T07:37:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ceb8d10d8cb2ffe6180c24cbd3e5ed8dbbb559b6

Modified files:
        ChangeLog libpurple/protocols/msn/contact.c

ChangeLog: 

The MSN AddressBook can contain contacts with global isMessengerUser=false,
but with isMessengerEnabled=true for a specific email (for federated/Yahoo!
buddies).
Re-arrange the code so it will find these types of contacts as well instead
of bailing when it thinks that the contact is not (globally) enabled for
messenger.
Now it should stop attempting to add federated/Yahoo! buddies to your list
repeatedly every time you sign in. You may need to manually remove the
duplicates (Not in Pidgin/Finch. See the FAQ for more info).

References #3322.
References #6755.

-------------- next part --------------
============================================================
--- ChangeLog	e35efc6838f3a38136d9428765641279e2220508
+++ ChangeLog	5342c31ba3bcad6c6f981c4f32937cc83dd11d99
@@ -2,11 +2,7 @@ version 2.5.5 (??/??/????):
 
 version 2.5.5 (??/??/????):
 	libpurple:
-	* Fix transfer of buddy icons, custom smileys, and files from the
-	  latest Windows Live Messenger 9 official client. (Thomas
-	  Gibson-Robinson)
 	* Fix a crash when removing an account with an unknown protocol id.
-	* Large (multi-part) messages on MSN are now correctly re-combined.
 	* Beta support for SSL connections for AIM and ICQ accounts.  To
 	  enable, check the "Use SSL" option from the Advanced tab when
 	  editing your AIM or ICQ account. (Paul Aurich)
@@ -14,6 +10,15 @@ version 2.5.5 (??/??/????):
 	  and other libpurple clients (fixes with libpurple users only on
 	  statuses other than Available). (Daniel Ljungborg)
 
+	MSN:
+	* Fix transfer of buddy icons, custom smileys, and files from the
+	  latest Windows Live Messenger 9 official client. (Thomas
+	  Gibson-Robinson)
+	* Large (multi-part) messages are now correctly re-combined.
+	* Federated/Yahoo! buddies should now stop creating sync issues at
+	  every signin.  You may need to remove duplicates in the Address
+	  Book.  See the FAQ for more information.
+
 	Finch:
 	* Allow rebinding keys to change the focused widget (details in the
 	  man-page, look for GntBox::binding)
============================================================
--- libpurple/protocols/msn/contact.c	5e7be7afa90563a898c84f956fc176f6361965c0
+++ libpurple/protocols/msn/contact.c	b330dd728699968be1c55fb9b4a22ce2ce1599b7
@@ -243,7 +243,7 @@ msn_parse_each_member(MsnSession *sessio
 			g_free(name);
 		}
 	}
- 
+
 	purple_debug_info("msn", "CL: %s name: %s, Type: %s, MembershipID: %s, NetworkID: %u\n",
 		node, passport, type, member_id == NULL ? "(null)" : member_id, nid);
 
@@ -525,7 +525,7 @@ msn_parse_addressbook_contacts(MsnSessio
 
 	for(contactNode = xmlnode_get_child(node, "Contact"); contactNode;
 				contactNode = xmlnode_get_next_twin(contactNode)) {
-		xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds, *messenger_user;
+		xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds;
 		xmlnode *annotation;
 		MsnUser *user;
 
@@ -556,58 +556,52 @@ msn_parse_addressbook_contacts(MsnSessio
 			continue; /* Not adding own account as buddy to buddylist */
 		}
 
-		/* ignore non-messenger contacts */
-		if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) {
-			char *is_messenger_user = xmlnode_get_data(messenger_user);
-
-			if(is_messenger_user && !strcmp(is_messenger_user, "false")) {
-				g_free(is_messenger_user);
-				continue;
-			}
-
-			g_free(is_messenger_user);
-		}
-
 		passportName = xmlnode_get_child(contactInfo, "passportName");
 		if (passportName == NULL) {
 			xmlnode *emailsNode, *contactEmailNode, *emailNode;
 			xmlnode *messengerEnabledNode;
 			char *msnEnabled;
 
-			/*TODO: add it to the none-instant Messenger group and recognize as email Membership*/
-			/*Yahoo User?*/
+			/*TODO: add it to the non-instant Messenger group and recognize as email Membership*/
+			/* Yahoo/Federated User? */
 			emailsNode = xmlnode_get_child(contactInfo, "emails");
 			if (emailsNode == NULL) {
 				/*TODO:  need to support the Mobile type*/
 				continue;
 			}
 			for (contactEmailNode = xmlnode_get_child(emailsNode, "ContactEmail"); contactEmailNode;
-					contactEmailNode = xmlnode_get_next_twin(contactEmailNode) ){
-				if (!(messengerEnabledNode = xmlnode_get_child(contactEmailNode, "isMessengerEnabled"))) {
-					/* XXX: Should this be a continue instead of a break? It seems like it'd cause unpredictable results otherwise. */
-					break;
-				}
+					contactEmailNode = xmlnode_get_next_twin(contactEmailNode)) {
+				if (!(messengerEnabledNode = xmlnode_get_child(contactEmailNode, "isMessengerEnabled")))
+					continue;
 
 				msnEnabled = xmlnode_get_data(messengerEnabledNode);
 
-				if ((emailNode = xmlnode_get_child(contactEmailNode, "email"))) {
-					g_free(passport);
-					passport = xmlnode_get_data(emailNode);
-				}
+				if (msnEnabled && !strcmp(msnEnabled, "true")) {
+					if ((emailNode = xmlnode_get_child(contactEmailNode, "email")))
+						passport = xmlnode_get_data(emailNode);
 
-				if (msnEnabled && !strcmp(msnEnabled, "true")) {
 					/*Messenger enabled, Get the Passport*/
-					purple_debug_info("msn", "AB Yahoo User %s\n", passport ? passport : "(null)");
+					purple_debug_info("msn", "AB Yahoo/Federated User %s\n", passport ? passport : "(null)");
 					g_free(msnEnabled);
 					break;
-				} else {
-					/*TODO maybe we can just ignore it in Purple?*/
-					purple_debug_info("msn", "AB Other type user\n");
 				}
 
 				g_free(msnEnabled);
 			}
 		} else {
+			xmlnode *messenger_user;
+			/* ignore non-messenger contacts */
+			if ((messenger_user = xmlnode_get_child(contactInfo, "isMessengerUser"))) {
+				char *is_messenger_user = xmlnode_get_data(messenger_user);
+
+				if (is_messenger_user && !strcmp(is_messenger_user, "false")) {
+					g_free(is_messenger_user);
+					continue;
+				}
+
+				g_free(is_messenger_user);
+			}
+
 			passport = xmlnode_get_data(passportName);
 		}
 


More information about the Commits mailing list