# HG changeset patch # User Mark Doliner # Date 1229472365 0 # Node ID 75ecd41a64ba60a13eeb8c1f198d6e5039f02514 # Parent 722732726d9111983b01915e8c86673d37e788c7 Fix a bug where if "Show our presence only to people on our buddy list" is true and we remove someone from our buddy list then re-add them they would not see our presence until the next time we logged out and back on. diff -r 722732726d91 -r 75ecd41a64ba libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Tue Dec 16 23:43:25 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Wed Dec 17 00:06:05 2008 +0000 @@ -2549,6 +2549,7 @@ MsimMessage *msg; MsimMessage *msg_persist; MsimMessage *body; + GList *blocklist_updates; session = (MsimSession *)gc->proto_data; purple_debug_info("msim", "msim_add_buddy: want to add %s to %s\n", @@ -2601,6 +2602,27 @@ return; } msim_msg_free(msg_persist); + + /* Remove the buddy from our block list and add them to our accept list, I think */ + blocklist_updates = NULL; + blocklist_updates = g_list_prepend(blocklist_updates, "a+"); + blocklist_updates = g_list_prepend(blocklist_updates, ""); + blocklist_updates = g_list_prepend(blocklist_updates, "b-"); + blocklist_updates = g_list_prepend(blocklist_updates, ""); + blocklist_updates = g_list_reverse(blocklist_updates); + + msg = msim_msg_new( + "blocklist", MSIM_TYPE_BOOLEAN, TRUE, + "sesskey", MSIM_TYPE_INTEGER, session->sesskey, + /* TODO: MsimMessage lists. Currently isn't replaced in lists. */ + /* "idlist", MSIM_TYPE_STRING, g_strdup("a-||b-|"), */ + "idlist", MSIM_TYPE_LIST, blocklist_updates, + NULL); + + if (!msim_postprocess_outgoing(session, msg, buddy->name, "idlist", NULL)) + purple_debug_error("myspace", "blocklist command failed\n"); + + msim_msg_free(msg); } /** @@ -2649,6 +2671,7 @@ } msim_msg_free(persist_msg); + /* Remove the buddy from our block list(huh?) and our accept list */ blocklist_updates = NULL; blocklist_updates = g_list_prepend(blocklist_updates, "a-"); blocklist_updates = g_list_prepend(blocklist_updates, "");