pidgin: 598a42ce: Read the MPOP setting from the AB.

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 2 01:35:47 EST 2010


----------------------------------------------------------------------
Revision: 598a42cee11b05ea3af9bc9cdcb5c3e297c3d755
Parent:   466913c83f3af67699061111c981570f06978200
Author:   qulogic at pidgin.im
Date:     12/02/10 01:14:19
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/598a42cee11b05ea3af9bc9cdcb5c3e297c3d755

Changelog: 

Read the MPOP setting from the AB.

Refs #13017.

Changes against parent 466913c83f3af67699061111c981570f06978200

  patched  libpurple/protocols/msn/contact.c
  patched  libpurple/protocols/msn/msn.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	a23e23c7ba45eb2d8b5069c8005f0cec7c6fc2e3
+++ libpurple/protocols/msn/msn.c	c07683fe4e2f5216c417f072674ca3bfeff6e797
@@ -1201,7 +1201,8 @@ msn_actions(PurplePlugin *plugin, gpoint
 	m = g_list_append(m, act);
 	m = g_list_append(m, NULL);
 
-	if (session->protocol_ver >= 16)
+	if (purple_account_get_bool(session->account, "mpop", TRUE)
+	 && session->protocol_ver >= 16)
 	{
 		act = purple_plugin_action_new(_("View Locations..."),
 		                               msn_show_locations);
@@ -3085,6 +3086,11 @@ init_plugin(PurplePlugin *plugin)
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
 											   option);
 
+	option = purple_account_option_bool_new(_("Allow connecting from multiple locations"),
+										  "mpop", TRUE);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
+
 	purple_cmd_register("nudge", "", PURPLE_CMD_P_PRPL,
 	                  PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY,
 	                 "prpl-msn", msn_cmd_nudge,
============================================================
--- libpurple/protocols/msn/contact.c	e09e7c6e5d31ffd2c8434c1347140e7562351ff9
+++ libpurple/protocols/msn/contact.c	5cbae1b54efa8987ba7f7c2807c6efbc9c58078f
@@ -710,8 +710,9 @@ msn_parse_addressbook_contacts(MsnSessio
 		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 @@ msn_parse_addressbook_contacts(MsnSessio
 					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 */
 		}
 


More information about the Commits mailing list