# HG changeset patch # User Luke Schierer # Date 1052886909 0 # Node ID c4e7a079cc046c0ea80140f795805ed4cdbd31db # Parent fc0441fbf159db15bbf3da9b772ce8a921caa916 [gaim-migrate @ 5744] this won't make things worse, and it should at very least reduce the frequency with which gaim displays groups with negative counts committer: Tailor Script diff -r fc0441fbf159 -r c4e7a079cc04 src/blist.c --- a/src/blist.c Wed May 14 04:11:23 2003 +0000 +++ b/src/blist.c Wed May 14 04:35:09 2003 +0000 @@ -184,7 +184,8 @@ buddy->present = GAIM_BUDDY_SIGNING_OFF; gaim_event_broadcast(event_buddy_signoff, buddy->account->gc, buddy->name); do_timer = TRUE; - ((struct group *)((GaimBlistNode *)buddy)->parent)->online--; + if( ((struct group *)((GaimBlistNode *)buddy)->parent)->online > 0) + ((struct group *)((GaimBlistNode *)buddy)->parent)->online--; } if(do_timer) { @@ -450,10 +451,11 @@ /* This buddy was already in the list and is * being moved. */ - ((struct group *)bnode->parent)->totalsize--; - if (buddy->account->gc) + if( ((struct group *)bnode->parent)->totalsize > 0) + ((struct group *)bnode->parent)->totalsize--; + if (buddy->account->gc && ( ((struct group*)bnode->parent)->currentsize > 0) ) ((struct group *)bnode->parent)->currentsize--; - if (buddy->present) + if (buddy->present && ( ((struct group *)bnode->parent)->online > 0) ) ((struct group *)bnode->parent)->online--; if(bnode->next) @@ -607,8 +609,9 @@ node->prev->next = node->next; if (node->next) node->next->prev = node->prev; - group->totalsize--; - if (buddy->account->gc) + if(group->totalsize >0) + group->totalsize--; + if (buddy->account->gc && group->currentsize > 0) group->currentsize--; hb.name = normalize(buddy->name); @@ -802,10 +805,11 @@ for(buddy = group->child; buddy; buddy = buddy->next) { if(GAIM_BLIST_NODE_IS_BUDDY(buddy)) { if (account == ((struct buddy*)buddy)->account) { - if (((struct buddy *)buddy)->present) + if (((struct buddy *)buddy)->present > 0) ((struct group *)group)->online--; ((struct buddy*)buddy)->present = GAIM_BUDDY_OFFLINE; - ((struct group *)group)->currentsize--; + if ( ((struct group*)buddy->parent)->currentsize > 0) + ((struct group *)group)->currentsize--; if(ops) ops->remove(gaimbuddylist, buddy); } diff -r fc0441fbf159 -r c4e7a079cc04 src/gtkblist.c --- a/src/gtkblist.c Wed May 14 04:11:23 2003 +0000 +++ b/src/gtkblist.c Wed May 14 04:35:09 2003 +0000 @@ -1521,8 +1521,6 @@ struct gaim_buddy_list *blist; struct gaim_gtk_buddy_list *gtkblist; - gaim_debug(GAIM_DEBUG_INFO, "update_refresh_timeout", "called\n"); - blist = gaim_get_blist(); gtkblist = GAIM_GTK_BLIST(gaim_get_blist());