changeset 5287:abd6d3abbe37

[gaim-migrate @ 5659] lets see if we can get group numbers right for chats ;-) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 03 May 2003 02:20:03 +0000
parents f82c251c8300
children 92cbe9541c3b
files src/blist.c
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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);