changeset 5041:c4b691b0cc0d

[gaim-migrate @ 5385] some dragging fixes. hopefully kill off the last of the hangs and crashes associated with dragging buddies and editng the list committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 05 Apr 2003 18:47:34 +0000
parents 9af91af51192
children 20b4b0328a3e
files src/buddy.c src/list.c
diffstat 2 files changed, 16 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Sat Apr 05 18:46:37 2003 +0000
+++ b/src/buddy.c	Sat Apr 05 18:47:34 2003 +0000
@@ -1410,13 +1410,8 @@
 
 	if (get_iter_from_node(node, &iter)) {
 		gtk_tree_store_remove(gtkblist->treemodel, &iter);
-		if(GAIM_BLIST_NODE_IS_BUDDY(node) &&
-		   !(blist_options & OPT_BLIST_SHOW_OFFLINE) &&
-		   (blist_options & OPT_BLIST_NO_MT_GRP) &&
-		   !gaim_blist_get_group_online_count((struct group *)node->parent)) {
-			GtkTreeIter groupiter;
-			if(get_iter_from_node(node->parent, &groupiter))
-				gtk_tree_store_remove(gtkblist->treemodel, &groupiter);
+		if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
+			gaim_gtk_blist_update(list, node->parent);
 		}
 	}
 }
--- a/src/list.c	Sat Apr 05 18:46:37 2003 +0000
+++ b/src/list.c	Sat Apr 05 18:47:34 2003 +0000
@@ -208,7 +208,7 @@
 }
 void  gaim_blist_add_buddy (struct buddy *buddy, struct group *group, GaimBlistNode *node)
 {
-	GaimBlistNode *n = node, *node2, *node3;
+	GaimBlistNode *n = node, *bnode = (GaimBlistNode*)buddy;
 	struct group *g = group;
 	struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops;
 	gboolean save = FALSE;
@@ -224,28 +224,30 @@
 	}
 
 	/* if we're moving to overtop of ourselves, do nothing */
-	if((GaimBlistNode*)buddy == n)
+	if(bnode == n)
 		return;
 
-	if (((GaimBlistNode*)buddy)->parent) {
+	if (bnode->parent) {
 		/* This buddy was already in the list and is
 		 * being moved.
 		 */
-		ops->remove(gaimbuddylist, (GaimBlistNode*)buddy);
-		node2 = ((GaimBlistNode*)buddy)->next;
-		node3 = ((GaimBlistNode*)buddy)->prev;
+		if(bnode->next)
+			bnode->next->prev = bnode->prev;
+		if(bnode->prev)
+			bnode->prev->next = bnode->next;
+		if(bnode->parent->child == bnode)
+			bnode->parent->child = bnode->next;
 
-		if (node2)
-			node2->prev = node3;
-		if (node3)
-			node3->next = node2;
+		ops->remove(gaimbuddylist, bnode);
 
-		if (((GaimBlistNode*)buddy)->parent != ((GaimBlistNode*)g))
-			serv_move_buddy(buddy, (struct group*)((GaimBlistNode*)buddy)->parent, g);
+		if (bnode->parent != ((GaimBlistNode*)g))
+			serv_move_buddy(buddy, (struct group*)bnode->parent, g);
 		save = TRUE;
 	}
 
 	if (n) {
+		if(n->next)
+			n->next->prev = (GaimBlistNode*)buddy;
 		((GaimBlistNode*)buddy)->next = n->next;
 		((GaimBlistNode*)buddy)->prev = n;
 		((GaimBlistNode*)buddy)->parent = n->parent;