diff libpurple/protocols/msn/contact.c @ 30990:05b3fa3725a1

Read the MPOP setting from the AB. Refs #13017.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 02 Dec 2010 06:14:19 +0000
parents 5c2af6c30e52
children 3cff7a5e0351
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Thu Dec 02 06:04:55 2010 +0000
+++ b/libpurple/protocols/msn/contact.c	Thu Dec 02 06:14:19 2010 +0000
@@ -710,8 +710,9 @@
 		uid = xmlnode_get_data(contactId);
 		type = xmlnode_get_data(contactType);
 
-		/*setup the Display Name*/
+		/* Find out our settings */
 		if (type && !strcmp(type, "Me")) {
+			/* setup the Display Name */
 			if (purple_connection_get_display_name(pc) == NULL) {
 				char *friendly = NULL;
 				if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
@@ -720,6 +721,23 @@
 					friendly ? purple_url_decode(friendly) : NULL);
 				g_free(friendly);
 			}
+
+			for (annotation = xmlnode_get_child(contactInfo, "annotations/Annotation");
+			     annotation;
+			     annotation = xmlnode_get_next_twin(annotation)) {
+				char *name, *value;
+				name = xmlnode_get_data(xmlnode_get_child(annotation, "Name"));
+				value = xmlnode_get_data(xmlnode_get_child(annotation, "Value"));
+				if (!strcmp(name, "MSN.IM.MPOP")) {
+					if (!value || atoi(value) != 0)
+						purple_account_set_bool(session->account, "mpop", TRUE);
+					else
+						purple_account_set_bool(session->account, "mpop", FALSE);
+				}
+				g_free(name);
+				g_free(value);
+			}
+
 			continue; /* Not adding own account as buddy to buddylist */
 		}