src/blist.c

changeset 5855
d95791d925db
parent 5776
7a738fde3ab1
child 5872
754c63f29b77
equal deleted inserted replaced
5854:27de8b637dc9 5855:d95791d925db
381 if (cnode->parent) { 381 if (cnode->parent) {
382 /* This chat was already in the list and is 382 /* This chat was already in the list and is
383 * being moved. 383 * being moved.
384 */ 384 */
385 ((struct group *)cnode->parent)->totalsize--; 385 ((struct group *)cnode->parent)->totalsize--;
386 if (chat->account->gc) { 386 if (gaim_account_is_connected(chat->account)) {
387 ((struct group *)cnode->parent)->online--; 387 ((struct group *)cnode->parent)->online--;
388 ((struct group *)cnode->parent)->currentsize--; 388 ((struct group *)cnode->parent)->currentsize--;
389 } 389 }
390 if(cnode->next) 390 if(cnode->next)
391 cnode->next->prev = cnode->prev; 391 cnode->next->prev = cnode->prev;
405 cnode->next = n->next; 405 cnode->next = n->next;
406 cnode->prev = n; 406 cnode->prev = n;
407 cnode->parent = n->parent; 407 cnode->parent = n->parent;
408 n->next = cnode; 408 n->next = cnode;
409 ((struct group *)n->parent)->totalsize++; 409 ((struct group *)n->parent)->totalsize++;
410 if (chat->account->gc) { 410 if (gaim_account_is_connected(chat->account)) {
411 ((struct group *)n->parent)->online++; 411 ((struct group *)n->parent)->online++;
412 ((struct group *)n->parent)->currentsize++; 412 ((struct group *)n->parent)->currentsize++;
413 } 413 }
414 } else { 414 } else {
415 if(((GaimBlistNode*)g)->child) 415 if(((GaimBlistNode*)g)->child)
417 cnode->next = ((GaimBlistNode*)g)->child; 417 cnode->next = ((GaimBlistNode*)g)->child;
418 cnode->prev = NULL; 418 cnode->prev = NULL;
419 ((GaimBlistNode*)g)->child = cnode; 419 ((GaimBlistNode*)g)->child = cnode;
420 cnode->parent = (GaimBlistNode*)g; 420 cnode->parent = (GaimBlistNode*)g;
421 g->totalsize++; 421 g->totalsize++;
422 if (chat->account->gc) { 422 if (gaim_account_is_connected(chat->account)) {
423 g->online++; 423 g->online++;
424 g->currentsize++; 424 g->currentsize++;
425 } 425 }
426 } 426 }
427 427
456 if (bnode->parent) { 456 if (bnode->parent) {
457 /* This buddy was already in the list and is 457 /* This buddy was already in the list and is
458 * being moved. 458 * being moved.
459 */ 459 */
460 ((struct group *)bnode->parent)->totalsize--; 460 ((struct group *)bnode->parent)->totalsize--;
461 if (buddy->account->gc) 461 if (gaim_account_is_connected(buddy->account))
462 ((struct group *)bnode->parent)->currentsize--; 462 ((struct group *)bnode->parent)->currentsize--;
463 if (GAIM_BUDDY_IS_ONLINE(buddy)) 463 if (GAIM_BUDDY_IS_ONLINE(buddy))
464 ((struct group *)bnode->parent)->online--; 464 ((struct group *)bnode->parent)->online--;
465 465
466 if(bnode->next) 466 if(bnode->next)
484 ((GaimBlistNode*)buddy)->next = n->next; 484 ((GaimBlistNode*)buddy)->next = n->next;
485 ((GaimBlistNode*)buddy)->prev = n; 485 ((GaimBlistNode*)buddy)->prev = n;
486 ((GaimBlistNode*)buddy)->parent = n->parent; 486 ((GaimBlistNode*)buddy)->parent = n->parent;
487 n->next = (GaimBlistNode*)buddy; 487 n->next = (GaimBlistNode*)buddy;
488 ((struct group *)n->parent)->totalsize++; 488 ((struct group *)n->parent)->totalsize++;
489 if (buddy->account->gc) 489 if (gaim_account_is_connected(buddy->account))
490 ((struct group *)n->parent)->currentsize++; 490 ((struct group *)n->parent)->currentsize++;
491 if (GAIM_BUDDY_IS_ONLINE(buddy)) 491 if (GAIM_BUDDY_IS_ONLINE(buddy))
492 ((struct group *)n->parent)->online++; 492 ((struct group *)n->parent)->online++;
493 } else { 493 } else {
494 if(((GaimBlistNode*)g)->child) 494 if(((GaimBlistNode*)g)->child)
496 ((GaimBlistNode*)buddy)->prev = NULL; 496 ((GaimBlistNode*)buddy)->prev = NULL;
497 ((GaimBlistNode*)buddy)->next = ((GaimBlistNode*)g)->child; 497 ((GaimBlistNode*)buddy)->next = ((GaimBlistNode*)g)->child;
498 ((GaimBlistNode*)g)->child = (GaimBlistNode*)buddy; 498 ((GaimBlistNode*)g)->child = (GaimBlistNode*)buddy;
499 ((GaimBlistNode*)buddy)->parent = (GaimBlistNode*)g; 499 ((GaimBlistNode*)buddy)->parent = (GaimBlistNode*)g;
500 g->totalsize++; 500 g->totalsize++;
501 if (buddy->account->gc) 501 if (gaim_account_is_connected(buddy->account))
502 g->currentsize++; 502 g->currentsize++;
503 if (GAIM_BUDDY_IS_ONLINE(buddy)) 503 if (GAIM_BUDDY_IS_ONLINE(buddy))
504 g->online++; 504 g->online++;
505 } 505 }
506 506
621 if (node->prev) 621 if (node->prev)
622 node->prev->next = node->next; 622 node->prev->next = node->next;
623 if (node->next) 623 if (node->next)
624 node->next->prev = node->prev; 624 node->next->prev = node->prev;
625 group->totalsize--; 625 group->totalsize--;
626 if (buddy->account->gc) 626 if (gaim_account_is_connected(buddy->account))
627 group->currentsize--; 627 group->currentsize--;
628 if (GAIM_BUDDY_IS_ONLINE(buddy)) 628 if (GAIM_BUDDY_IS_ONLINE(buddy))
629 group->online--; 629 group->online--;
630 630
631 hb.name = normalize(buddy->name); 631 hb.name = normalize(buddy->name);
662 if (node->prev) 662 if (node->prev)
663 node->prev->next = node->next; 663 node->prev->next = node->next;
664 if (node->next) 664 if (node->next)
665 node->next->prev = node->prev; 665 node->next->prev = node->prev;
666 group->totalsize--; 666 group->totalsize--;
667 if (chat->account->gc) { 667 if (gaim_account_is_connected(chat->account)) {
668 group->currentsize--; 668 group->currentsize--;
669 group->online--; 669 group->online--;
670 } 670 }
671 671
672 ops->remove(gaimbuddylist, node); 672 ops->remove(gaimbuddylist, node);
1234 GaimBlistNode *bnode; 1234 GaimBlistNode *bnode;
1235 for(bnode = g->node.child; bnode; bnode = bnode->next) { 1235 for(bnode = g->node.child; bnode; bnode = bnode->next) {
1236 struct buddy *b = (struct buddy *)bnode; 1236 struct buddy *b = (struct buddy *)bnode;
1237 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) 1237 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
1238 continue; 1238 continue;
1239 if((!account && b->account->gc) || b->account == account) 1239 if((!account && gaim_account_is_connected(b->account))
1240 || b->account == account)
1240 return TRUE; 1241 return TRUE;
1241 } 1242 }
1242 return FALSE; 1243 return FALSE;
1243 } 1244 }
1244 1245

mercurial