comparison libpurple/protocols/oscar/family_feedbag.c @ 19649:c6f1f9971c4a

When doing oscar server-side list management, do deletions before additions because if it's done the other way then it's possible for Pidgin to try to add one buddy to two different groups, which isn't allowed for ICQ. Fixes schoen's comment at http://developer.pidgin.im/ticket/576 References #576.
author Mark Doliner <mark@kingant.net>
date Wed, 05 Sep 2007 05:43:08 +0000
parents 84d53c3c699d
children 44b4e8bd759b
comparison
equal deleted inserted replaced
19648:450f4a3c4c0f 19649:c6f1f9971c4a
503 * additions, then modifications. Also, both the official and the local 503 * additions, then modifications. Also, both the official and the local
504 * list should be in ascending numerical order for the group ID#s and the 504 * list should be in ascending numerical order for the group ID#s and the
505 * buddy ID#s, which makes things more efficient. I think. 505 * buddy ID#s, which makes things more efficient. I think.
506 */ 506 */
507 507
508 /* Additions */ 508 /* Deletions */
509 if (!od->ssi.pending) { 509 if (!od->ssi.pending) {
510 for (cur1=od->ssi.local; cur1 && (n < 15); cur1=cur1->next) { 510 for (cur1=od->ssi.official; cur1 && (n < 15); cur1=cur1->next) {
511 if (!aim_ssi_itemlist_find(od->ssi.official, cur1->gid, cur1->bid)) { 511 if (!aim_ssi_itemlist_find(od->ssi.local, cur1->gid, cur1->bid)) {
512 n++; 512 n++;
513 new = (struct aim_ssi_tmp *)g_malloc(sizeof(struct aim_ssi_tmp)); 513 new = (struct aim_ssi_tmp *)g_malloc(sizeof(struct aim_ssi_tmp));
514 new->action = SNAC_SUBTYPE_FEEDBAG_ADD; 514 new->action = SNAC_SUBTYPE_FEEDBAG_DEL;
515 new->ack = 0xffff; 515 new->ack = 0xffff;
516 new->name = NULL; 516 new->name = NULL;
517 new->item = cur1; 517 new->item = cur1;
518 new->next = NULL; 518 new->next = NULL;
519 if (od->ssi.pending) { 519 if (od->ssi.pending) {
523 od->ssi.pending = new; 523 od->ssi.pending = new;
524 } 524 }
525 } 525 }
526 } 526 }
527 527
528 /* Deletions */ 528 /* Additions */
529 if (!od->ssi.pending) { 529 if (!od->ssi.pending) {
530 for (cur1=od->ssi.official; cur1 && (n < 15); cur1=cur1->next) { 530 for (cur1=od->ssi.local; cur1 && (n < 15); cur1=cur1->next) {
531 if (!aim_ssi_itemlist_find(od->ssi.local, cur1->gid, cur1->bid)) { 531 if (!aim_ssi_itemlist_find(od->ssi.official, cur1->gid, cur1->bid)) {
532 n++; 532 n++;
533 new = (struct aim_ssi_tmp *)g_malloc(sizeof(struct aim_ssi_tmp)); 533 new = (struct aim_ssi_tmp *)g_malloc(sizeof(struct aim_ssi_tmp));
534 new->action = SNAC_SUBTYPE_FEEDBAG_DEL; 534 new->action = SNAC_SUBTYPE_FEEDBAG_ADD;
535 new->ack = 0xffff; 535 new->ack = 0xffff;
536 new->name = NULL; 536 new->name = NULL;
537 new->item = cur1; 537 new->item = cur1;
538 new->next = NULL; 538 new->next = NULL;
539 if (od->ssi.pending) { 539 if (od->ssi.pending) {