# HG changeset patch # User Mark Doliner # Date 1043004389 0 # Node ID 2903c656875ab6502ea19f420c2c5a1a3feff007 # Parent 38e275e1a793492be14db5d883efd0446288428b [gaim-migrate @ 4611] This Bud's for Luke! committer: Tailor Script diff -r 38e275e1a793 -r 2903c656875a src/protocols/oscar/ssi.c --- a/src/protocols/oscar/ssi.c Sun Jan 19 18:05:45 2003 +0000 +++ b/src/protocols/oscar/ssi.c Sun Jan 19 19:26:29 2003 +0000 @@ -643,7 +643,11 @@ { struct aim_ssi_item *cur, *next; - /* Delete any buddies, permits, or denies with empty names */ + /* Delete any buddies, permits, or denies with empty names. */ + /* If there are any buddies directly in the master group, add them to a real group. */ + /* DESTROY any buddies that are directly in the master group. */ + /* Do the same for buddies that are in a non-existant group. */ + /* This will kind of mess up if you hit the item limit, but this function isn't too critical */ cur = sess->ssi.local; while (cur) { next = cur->next; @@ -654,25 +658,13 @@ aim_ssi_delpermit(sess, conn, cur->name); else if (cur->type == AIM_SSI_TYPE_DENY) aim_ssi_deldeny(sess, conn, cur->name); + } else if ((cur->type == AIM_SSI_TYPE_BUDDY) && ((cur->gid == 0x0000) || (!aim_ssi_itemlist_find(sess->ssi.local, cur->gid, 0x0000)))) { + aim_ssi_addbuddy(sess, conn, cur->name, "orphans", NULL, NULL, NULL, 0); + aim_ssi_delbuddy(sess, conn, cur->name, NULL); } cur = next; } - /* If there are any buddies directly in the master group, put them in a real group */ - /* This will kind of mess up if you hit the item limit, but this function isn't too critical */ - for (cur=sess->ssi.local; cur; cur=cur->next) - if ((cur->type == AIM_SSI_TYPE_BUDDY) && (cur->gid == 0x0000)) - aim_ssi_addbuddy(sess, conn, cur->name, "orphans", NULL, NULL, NULL, 0); - - /* Now DESTROY any buddies that are directly in the master group */ - cur = sess->ssi.local; - while (cur) { - next = cur->next; - if ((cur->type == AIM_SSI_TYPE_BUDDY) && (cur->gid == 0x0000)) - aim_ssi_delbuddy(sess, conn, cur->name, NULL); - cur = next; - } - /* Check if there are empty groups */ cur = sess->ssi.local; while (cur) {