src/blist.c

changeset 5287
ac05902f0535
parent 5278
8c9ac4446f1e
child 5292
0a61986ed08f
--- a/src/blist.c	Fri May 02 21:25:49 2003 +0000
+++ b/src/blist.c	Sat May 03 02:20:03 2003 +0000
@@ -338,8 +338,10 @@
 		 * being moved.
 		 */
 		((struct group *)cnode->parent)->totalsize--;
-		if (chat->account->gc)
+		if (chat->account->gc) {
+			((struct group *)cnode->parent)->online--;
 			((struct group *)cnode->parent)->currentsize--;
+		}
 		if(cnode->next)
 			cnode->next->prev = cnode->prev;
 		if(cnode->prev)
@@ -347,8 +349,6 @@
 		if(cnode->parent->child == cnode)
 			cnode->parent->child = cnode->next;
 
-		((struct group *)((GaimBlistNode *)chat)->parent)->online--;
-
 		ops->remove(gaimbuddylist, cnode);
 
 		save = TRUE;
@@ -362,19 +362,21 @@
 		cnode->parent = n->parent;
 		n->next = cnode;
 		((struct group *)n->parent)->totalsize++;
-		if (chat->account->gc)
+		if (chat->account->gc) {
+			((struct group *)n->parent)->online++;
 			((struct group *)n->parent)->currentsize++;
+		}
 	} else {
 		((GaimBlistNode*)g)->child = cnode;
 		cnode->next = cnode->prev = NULL;
 		cnode->parent = (GaimBlistNode*)g;
 		g->totalsize++;
-		if (chat->account->gc)
+		if (chat->account->gc) {
+			g->online++;
 			g->currentsize++;
+		}
 	}
 
-	((struct group *)((GaimBlistNode *)chat)->parent)->online++;
-
 	if (ops)
 		ops->update(gaimbuddylist, (GaimBlistNode*)cnode);
 	if (save)
@@ -726,6 +728,7 @@
 				}
 			} else if(GAIM_BLIST_NODE_IS_CHAT(buddy)) {
 				if (account == ((struct chat*)buddy)->account) {
+					((struct group *)group)->online++;
 					((struct group *)group)->currentsize++;
 					if(ops)
 						ops->update(gaimbuddylist, buddy);

mercurial