changeset 22554:8041c74e36d7

patch from Maiku to ignore non-messenger contacts, fixes #3305
author Ka-Hing Cheung <khc@hxbc.us>
date Sat, 29 Mar 2008 16:03:16 +0000
parents 1168dc635ac1
children 23be4e39e128
files libpurple/protocols/msn/contact.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Fri Mar 28 07:58:20 2008 +0000
+++ b/libpurple/protocols/msn/contact.c	Sat Mar 29 16:03:16 2008 +0000
@@ -525,7 +525,7 @@
 
 	for(contactNode = xmlnode_get_child(node, "Contact"); contactNode;
 				contactNode = xmlnode_get_next_twin(contactNode)) {
-		xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds;
+		xmlnode *contactId, *contactInfo, *contactType, *passportName, *displayName, *guid, *groupIds, *messenger_user;
 		MsnUser *user;
 		MsnUserType usertype;
 
@@ -554,6 +554,18 @@
 			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);
+		}
+
 		usertype = msn_get_user_type(type);
 		passportName = xmlnode_get_child(contactInfo, "passportName");
 		if (passportName == NULL) {