pidgin: eba94769: The server list is definitive for who is...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue May 26 23:25:45 EDT 2009


-----------------------------------------------------------------
Revision: eba94769cf24823b383b30ace390657d3b9f3533
Ancestor: d5451d4ca60f9201d94adc9dc0cea60cd2f68eba
Author: darkrain42 at pidgin.im
Date: 2009-05-27T00:57:17
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/eba94769cf24823b383b30ace390657d3b9f3533

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

The server list is definitive for who is blocked.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	f33da2858aaff88e489b1e54acab5508176e77f5
+++ libpurple/protocols/jabber/jabber.c	7e0377f42fa59b99b8842f45a9771d0bf2995c98
@@ -1716,21 +1716,23 @@ static void jabber_blocklist_parse(Jabbe
 			"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);
 	}


More information about the Commits mailing list