# HG changeset patch # User Nathan Walp # Date 1055526902 0 # Node ID 082982a4acbd0ce47cf72845859795f3e2fb258d # Parent 14891982dbee5df4b194b98963114d2b4e10632e [gaim-migrate @ 6286] ok, this will get rid of the negative group counts for trepia, and also fixes the accounts dialog so signing off of an account leaves it signed off committer: Tailor Script diff -r 14891982dbee -r 082982a4acbd src/blist.c --- a/src/blist.c Fri Jun 13 16:49:00 2003 +0000 +++ b/src/blist.c Fri Jun 13 17:55:02 2003 +0000 @@ -383,7 +383,7 @@ * being moved. */ ((struct group *)cnode->parent)->totalsize--; - if (chat->account->gc) { + if (gaim_account_is_connected(chat->account)) { ((struct group *)cnode->parent)->online--; ((struct group *)cnode->parent)->currentsize--; } @@ -407,7 +407,7 @@ cnode->parent = n->parent; n->next = cnode; ((struct group *)n->parent)->totalsize++; - if (chat->account->gc) { + if (gaim_account_is_connected(chat->account)) { ((struct group *)n->parent)->online++; ((struct group *)n->parent)->currentsize++; } @@ -419,7 +419,7 @@ ((GaimBlistNode*)g)->child = cnode; cnode->parent = (GaimBlistNode*)g; g->totalsize++; - if (chat->account->gc) { + if (gaim_account_is_connected(chat->account)) { g->online++; g->currentsize++; } @@ -458,7 +458,7 @@ * being moved. */ ((struct group *)bnode->parent)->totalsize--; - if (buddy->account->gc) + if (gaim_account_is_connected(buddy->account)) ((struct group *)bnode->parent)->currentsize--; if (GAIM_BUDDY_IS_ONLINE(buddy)) ((struct group *)bnode->parent)->online--; @@ -486,7 +486,7 @@ ((GaimBlistNode*)buddy)->parent = n->parent; n->next = (GaimBlistNode*)buddy; ((struct group *)n->parent)->totalsize++; - if (buddy->account->gc) + if (gaim_account_is_connected(buddy->account)) ((struct group *)n->parent)->currentsize++; if (GAIM_BUDDY_IS_ONLINE(buddy)) ((struct group *)n->parent)->online++; @@ -498,7 +498,7 @@ ((GaimBlistNode*)g)->child = (GaimBlistNode*)buddy; ((GaimBlistNode*)buddy)->parent = (GaimBlistNode*)g; g->totalsize++; - if (buddy->account->gc) + if (gaim_account_is_connected(buddy->account)) g->currentsize++; if (GAIM_BUDDY_IS_ONLINE(buddy)) g->online++; @@ -623,7 +623,7 @@ if (node->next) node->next->prev = node->prev; group->totalsize--; - if (buddy->account->gc) + if (gaim_account_is_connected(buddy->account)) group->currentsize--; if (GAIM_BUDDY_IS_ONLINE(buddy)) group->online--; @@ -664,7 +664,7 @@ if (node->next) node->next->prev = node->prev; group->totalsize--; - if (chat->account->gc) { + if (gaim_account_is_connected(chat->account)) { group->currentsize--; group->online--; } @@ -1236,7 +1236,8 @@ struct buddy *b = (struct buddy *)bnode; if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) continue; - if((!account && b->account->gc) || b->account == account) + if((!account && gaim_account_is_connected(b->account)) + || b->account == account) return TRUE; } return FALSE; diff -r 14891982dbee -r 082982a4acbd src/gtkaccount.c --- a/src/gtkaccount.c Fri Jun 13 16:49:00 2003 +0000 +++ b/src/gtkaccount.c Fri Jun 13 17:55:02 2003 +0000 @@ -1504,10 +1504,12 @@ COLUMN_ONLINE, &online, -1); - if (online) + if (online) { + account->gc->wants_to_die = TRUE; gaim_account_disconnect(account); - else + } else { gaim_account_connect(account); + } } static void diff -r 14891982dbee -r 082982a4acbd src/protocols/trepia/trepia.c --- a/src/protocols/trepia/trepia.c Fri Jun 13 16:49:00 2003 +0000 +++ b/src/protocols/trepia/trepia.c Fri Jun 13 17:55:02 2003 +0000 @@ -156,9 +156,20 @@ static void __clear_user_list(TrepiaSession *session) { - gaim_debug(GAIM_DEBUG_INFO, "trepia", "Clearing user list\n"); - g_hash_table_foreach(session->user_profiles, _remove_user_fnc, session); - gaim_debug(GAIM_DEBUG_INFO, "trepia", "Done clearing user list\n"); + GaimBlistNode *gnode, *bnode; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + bnode = gnode->child; + while(bnode) { + struct buddy *buddy = (struct buddy *)bnode; + if(GAIM_BLIST_NODE_IS_BUDDY(bnode) && + buddy->account == session->gc->account) { + bnode = bnode->next; + gaim_blist_remove_buddy(buddy); + } else { + bnode = bnode->next; + } + } + } } #if 0 @@ -1063,8 +1074,6 @@ { TrepiaSession *session = gc->proto_data; - __clear_user_list(session); - if (session->rxqueue != NULL) g_string_free(session->rxqueue, TRUE);