# HG changeset patch # User Mark Doliner # Date 1253757002 0 # Node ID c9d3bda6ef81d6ab6fb8dc1f0906f1c60eab7dfd # Parent ad04e3ffb3d5b44b8f022d6d3e685c3ee5947410 Fix some problems adding "stuff" to oscar buddy lists, where "stuff" is often buddies to block, but can also be buddies to allow or maybe your privacy setting. I imagine this eliminates some "unable to add buddy" errors. Apparently I discovered this idiosyncrasy on 2007-04-23 and fixed it for icon items in 5ee6fd5ddac3a8e8920941dee8be3ae5a615c105, but for some reason I didn't fix it for any other types of items. I'm also making this loop a bit less heavy handed... it used to require that new items had an itemID greater than every other item. Now it just makes sure the itemID is not equal the itemID and not equal to the groupID of any other item. Let it be known that the best way for me to fix blocking is to have people I don't want to talk to IM me. diff -r ad04e3ffb3d5 -r c9d3bda6ef81 libpurple/protocols/oscar/family_feedbag.c --- a/libpurple/protocols/oscar/family_feedbag.c Thu Sep 24 01:29:56 2009 +0000 +++ b/libpurple/protocols/oscar/family_feedbag.c Thu Sep 24 01:50:02 2009 +0000 @@ -135,13 +135,18 @@ } } while (exists); } - } else if (type == AIM_SSI_TYPE_ICONINFO) { + } else if (new->gid == 0x0000) { + /* + * This is weird, but apparently items in the root group can't + * have a buddy ID equal to any group ID. You'll get error + * 0x0003 when trying to add, which is "item already exists" + */ if (new->bid == 0xFFFF) { do { new->bid += 0x0001; exists = FALSE; for (cur = *list; cur != NULL; cur = cur->next) - if ((cur->bid >= new->bid) || (cur->gid >= new->bid)) { + if (cur->bid == new->bid || cur->gid == new->bid) { exists = TRUE; break; } @@ -153,7 +158,7 @@ new->bid += 0x0001; exists = FALSE; for (cur = *list; cur != NULL; cur = cur->next) - if ((cur->bid == new->bid) && (cur->gid == new->gid)) { + if (cur->bid == new->bid && cur->gid == new->gid) { exists = TRUE; break; }