# HG changeset patch # User Paul Aurich # Date 1243385837 0 # Node ID 1dcee141997d1a1b5e15a9c564a7ef54b0f5de82 # Parent 10c91922bc1ec97dc2cdcbfbabf1221de1e34c68 The server list is definitive for who is blocked. diff -r 10c91922bc1e -r 1dcee141997d libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Tue May 26 23:44:55 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed May 27 00:57:17 2009 +0000 @@ -1716,21 +1716,23 @@ "blocklist", "urn:xmpp:blocking"); account = purple_connection_get_account(js->gc); - if (blocklist == NULL) + if (type == JABBER_IQ_ERROR || blocklist == NULL) return; /* This is the only privacy method supported by XEP-0191 */ - if (account->perm_deny != PUPRLE_PRIVACY_DENY_USERS) + if (account->perm_deny != PURPLE_PRIVACY_DENY_USERS) account->perm_deny = PURPLE_PRIVACY_DENY_USERS; /* - * FIXME: We should probably completely override the local list with - * the contents of the server list instead of merging them. + * TODO: When account->deny is something more than a hash table, this can + * be re-written to find the set intersection and difference. */ + while (account->deny) + purple_privacy_deny_remove(account, account->deny->data, TRUE); + item = xmlnode_get_child(blocklist, "item"); while (item != NULL) { const char *jid = xmlnode_get_attrib(item, "jid"); - purple_privacy_deny_add(account, jid, TRUE); item = xmlnode_get_next_twin(item); }