# HG changeset patch # User Elliott Sales de Andrade # Date 1291270459 0 # Node ID 05b3fa3725a10634470e88f320a35eec92647380 # Parent 7bf659dbaceeb84ac600ab62051c530d5e6b7ddd Read the MPOP setting from the AB. Refs #13017. diff -r 7bf659dbacee -r 05b3fa3725a1 libpurple/protocols/msn/contact.c --- 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 */ } diff -r 7bf659dbacee -r 05b3fa3725a1 libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Thu Dec 02 06:04:55 2010 +0000 +++ b/libpurple/protocols/msn/msn.c Thu Dec 02 06:14:19 2010 +0000 @@ -1201,7 +1201,8 @@ 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 @@ 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,