pidgin: 71b118a4: When getting the privacy lists, set the ...

qulogic at pidgin.im qulogic at pidgin.im
Sun Dec 14 03:45:42 EST 2008


-----------------------------------------------------------------
Revision: 71b118a44b1df8c16e9123168fa8bd40c73a434e
Ancestor: 27bc2af8520e6a136c45cbc8960816006738d900
Author: qulogic at pidgin.im
Date: 2008-12-14T05:22:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/71b118a44b1df8c16e9123168fa8bd40c73a434e

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

ChangeLog: 

When getting the privacy lists, set the default network to unknown. If the
buddy is a PassportMember, then the network is Passport, otherwise it is
obtained from the MSN.IM.BuddyType annotation. Next change fixes the case
where there is no annotation (if the buddy was added with older version of
Pidgin, perhaps).

References #3322.
References #6755.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c	5f27f96e8b77fe81df6e8f2745569108e3c64c04
+++ libpurple/protocols/msn/contact.c	2bd381a7e10cb1bce0594c59ea336ea90402f459
@@ -224,19 +224,24 @@ msn_parse_each_member(MsnSession *sessio
 	char *member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId"));
 	MsnUser *user = msn_userlist_find_add_user(session->userlist, passport, NULL);
 	xmlnode *annotation;
-	guint nid = MSN_NETWORK_PASSPORT;
+	guint nid = MSN_NETWORK_UNKNOWN;
 
-	for (annotation = xmlnode_get_child(member, "Annotations/Annotation");
-	     annotation;
-	     annotation = xmlnode_get_next_twin(annotation)) {
-		char *name = xmlnode_get_data(xmlnode_get_child(annotation, "Name"));
-		if (name && !strcmp(name, "MSN.IM.BuddyType")) {
-			char *value = xmlnode_get_data(xmlnode_get_child(annotation, "Value"));
-			if (value != NULL)
-				nid = strtoul(value, NULL, 10);
-			g_free(value);
+	/* For EmailMembers, the network must be found in the annotations. */
+	if (!strcmp(node, "PassportName")) {
+		nid = MSN_NETWORK_PASSPORT;
+	} else {
+		for (annotation = xmlnode_get_child(member, "Annotations/Annotation");
+		     annotation;
+		     annotation = xmlnode_get_next_twin(annotation)) {
+			char *name = xmlnode_get_data(xmlnode_get_child(annotation, "Name"));
+			if (name && !strcmp(name, "MSN.IM.BuddyType")) {
+				char *value = xmlnode_get_data(xmlnode_get_child(annotation, "Value"));
+				if (value != NULL)
+					nid = strtoul(value, NULL, 10);
+				g_free(value);
+			}
+			g_free(name);
 		}
-		g_free(name);
 	}
  
 	purple_debug_info("msn", "CL: %s name: %s, Type: %s, MembershipID: %s, NetworkID: %u\n",


More information about the Commits mailing list