# HG changeset patch # User Elliott Sales de Andrade # Date 1229232172 0 # Node ID daabf16bd511043a0450c32ac367cac9f91c2c3c # Parent bba38f03085d117abcd46804a0259a422f2e98b2 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. diff -r bba38f03085d -r daabf16bd511 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Sun Dec 14 04:09:23 2008 +0000 +++ b/libpurple/protocols/msn/contact.c Sun Dec 14 05:22:52 2008 +0000 @@ -224,19 +224,24 @@ 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",