# HG changeset patch # User Elliott Sales de Andrade # Date 1291536793 0 # Node ID 388ca4797d7bfc3d1947cf879d60c1c90a86c3dd # Parent e9afcbec8f20b389a63397224d2cd1053e8d4d34 Replace the mpop account setting with a session boolean, because I can't get a good signal for when the user changes an account setting. diff -r e9afcbec8f20 -r 388ca4797d7b libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Sun Dec 05 03:09:52 2010 +0000 +++ b/libpurple/protocols/msn/contact.c Sun Dec 05 08:13:13 2010 +0000 @@ -732,9 +732,9 @@ 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); + session->enable_mpop = TRUE; else - purple_account_set_bool(session->account, "mpop", FALSE); + session->enable_mpop = FALSE; } g_free(name); g_free(value); diff -r e9afcbec8f20 -r 388ca4797d7b libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Sun Dec 05 03:09:52 2010 +0000 +++ b/libpurple/protocols/msn/msn.c Sun Dec 05 08:13:13 2010 +0000 @@ -1173,8 +1173,7 @@ m = g_list_append(m, act); m = g_list_append(m, NULL); - if (purple_account_get_bool(session->account, "mpop", TRUE) - && session->protocol_ver >= 16) + if (session->enable_mpop && session->protocol_ver >= 16) { act = purple_plugin_action_new(_("View Locations..."), msn_show_locations); diff -r e9afcbec8f20 -r 388ca4797d7b libpurple/protocols/msn/notification.c --- a/libpurple/protocols/msn/notification.c Sun Dec 05 03:09:52 2010 +0000 +++ b/libpurple/protocols/msn/notification.c Sun Dec 05 08:13:13 2010 +0000 @@ -1572,7 +1572,7 @@ /* Disconnect others, if MPOP is disabled */ if (is_me - && !purple_account_get_bool(session->account, "mpop", TRUE) + && !session->enable_mpop && strncasecmp(id + 1, session->guid, 36) != 0) { purple_debug_info("msn", "Disconnecting Endpoint %s\n", id); @@ -1599,7 +1599,7 @@ } } - if (is_me && purple_account_get_bool(session->account, "mpop", TRUE)) { + if (is_me && session->enable_mpop) { for (epNode = xmlnode_get_child(payloadNode, "PrivateEndpointData"); epNode; epNode = xmlnode_get_next_twin(epNode)) { diff -r e9afcbec8f20 -r 388ca4797d7b libpurple/protocols/msn/session.c --- a/libpurple/protocols/msn/session.c Sun Dec 05 03:09:52 2010 +0000 +++ b/libpurple/protocols/msn/session.c Sun Dec 05 08:13:13 2010 +0000 @@ -49,6 +49,7 @@ session->oim = msn_oim_new(session); session->protocol_ver = 0; + session->enable_mpop = TRUE; /* Default only */ session->guid = rand_guid(); diff -r e9afcbec8f20 -r 388ca4797d7b libpurple/protocols/msn/session.h --- a/libpurple/protocols/msn/session.h Sun Dec 05 03:09:52 2010 +0000 +++ b/libpurple/protocols/msn/session.h Sun Dec 05 08:13:13 2010 +0000 @@ -83,6 +83,7 @@ gboolean logged_in:1; /**< A temporal flag to ignore local buddy list adds. */ gboolean destroying:1; /**< A flag that states if the session is being destroyed. */ gboolean http_method:1; + gboolean enable_mpop:1; /**< Use Multiple Points of Presence? */ int adl_fqy; /**< A count of ADL/FQY so status is only changed once. */ guint login_timeout; /**< Timeout to force status change if ADL/FQY fail. */