Mercurial > pidgin
comparison src/protocols/oscar/ssi.c @ 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 | d6f1086d52a6 |
children | 9fcc9eb94cae |
comparison
equal
deleted
inserted
replaced
4345:38e275e1a793 | 4346:2903c656875a |
---|---|
641 */ | 641 */ |
642 faim_export int aim_ssi_cleanlist(aim_session_t *sess, aim_conn_t *conn) | 642 faim_export int aim_ssi_cleanlist(aim_session_t *sess, aim_conn_t *conn) |
643 { | 643 { |
644 struct aim_ssi_item *cur, *next; | 644 struct aim_ssi_item *cur, *next; |
645 | 645 |
646 /* Delete any buddies, permits, or denies with empty names */ | 646 /* Delete any buddies, permits, or denies with empty names. */ |
647 /* If there are any buddies directly in the master group, add them to a real group. */ | |
648 /* DESTROY any buddies that are directly in the master group. */ | |
649 /* Do the same for buddies that are in a non-existant group. */ | |
650 /* This will kind of mess up if you hit the item limit, but this function isn't too critical */ | |
647 cur = sess->ssi.local; | 651 cur = sess->ssi.local; |
648 while (cur) { | 652 while (cur) { |
649 next = cur->next; | 653 next = cur->next; |
650 if (!cur->name) { | 654 if (!cur->name) { |
651 if (cur->type == AIM_SSI_TYPE_BUDDY) | 655 if (cur->type == AIM_SSI_TYPE_BUDDY) |
652 aim_ssi_delbuddy(sess, conn, cur->name, NULL); | 656 aim_ssi_delbuddy(sess, conn, cur->name, NULL); |
653 else if (cur->type == AIM_SSI_TYPE_PERMIT) | 657 else if (cur->type == AIM_SSI_TYPE_PERMIT) |
654 aim_ssi_delpermit(sess, conn, cur->name); | 658 aim_ssi_delpermit(sess, conn, cur->name); |
655 else if (cur->type == AIM_SSI_TYPE_DENY) | 659 else if (cur->type == AIM_SSI_TYPE_DENY) |
656 aim_ssi_deldeny(sess, conn, cur->name); | 660 aim_ssi_deldeny(sess, conn, cur->name); |
661 } else if ((cur->type == AIM_SSI_TYPE_BUDDY) && ((cur->gid == 0x0000) || (!aim_ssi_itemlist_find(sess->ssi.local, cur->gid, 0x0000)))) { | |
662 aim_ssi_addbuddy(sess, conn, cur->name, "orphans", NULL, NULL, NULL, 0); | |
663 aim_ssi_delbuddy(sess, conn, cur->name, NULL); | |
657 } | 664 } |
658 cur = next; | |
659 } | |
660 | |
661 /* If there are any buddies directly in the master group, put them in a real group */ | |
662 /* This will kind of mess up if you hit the item limit, but this function isn't too critical */ | |
663 for (cur=sess->ssi.local; cur; cur=cur->next) | |
664 if ((cur->type == AIM_SSI_TYPE_BUDDY) && (cur->gid == 0x0000)) | |
665 aim_ssi_addbuddy(sess, conn, cur->name, "orphans", NULL, NULL, NULL, 0); | |
666 | |
667 /* Now DESTROY any buddies that are directly in the master group */ | |
668 cur = sess->ssi.local; | |
669 while (cur) { | |
670 next = cur->next; | |
671 if ((cur->type == AIM_SSI_TYPE_BUDDY) && (cur->gid == 0x0000)) | |
672 aim_ssi_delbuddy(sess, conn, cur->name, NULL); | |
673 cur = next; | 665 cur = next; |
674 } | 666 } |
675 | 667 |
676 /* Check if there are empty groups */ | 668 /* Check if there are empty groups */ |
677 cur = sess->ssi.local; | 669 cur = sess->ssi.local; |