changeset 4346:2903c656875a

[gaim-migrate @ 4611] This Bud's for Luke! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 19 Jan 2003 19:26:29 +0000
parents 38e275e1a793
children 9fcc9eb94cae
files src/protocols/oscar/ssi.c
diffstat 1 files changed, 8 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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) {