changeset 5368:c4e7a079cc04

[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 <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 14 May 2003 04:35:09 +0000
parents fc0441fbf159
children a87818e9dc54
files src/blist.c src/gtkblist.c
diffstat 2 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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);
 				}
--- 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());