Update of /cvsroot/gaim/gaim/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19968/src
Modified Files:
blist.c blist.h gtkblist.c
Log Message:
1. fix 822297 (add/remove button in conv window not changing)
2. make dragging a contact into an expanded contact put the dragged one
where you wanted it
Index: blist.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/blist.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -p -r1.102 -r1.103
--- blist.c 13 Oct 2003 00:11:48 -0000 1.102
+++ blist.c 13 Oct 2003 03:48:35 -0000 1.103
@@ -902,23 +902,36 @@ void gaim_blist_add_contact(GaimContact
gaim_blist_save();
}
-void gaim_blist_merge_contact(GaimContact *source, GaimContact *target)
+void gaim_blist_merge_contact(GaimContact *source, GaimBlistNode *node)
{
GaimBlistNode *sourcenode = (GaimBlistNode*)source;
- GaimBlistNode *targetnode = (GaimBlistNode*)target;
- GaimBlistNode *child, *child2;
+ GaimBlistNode *targetnode;
+ GaimBlistNode *prev, *cur, *next;
+ GaimContact *target;
- if(source == target)
+ if(GAIM_BLIST_NODE_IS_CONTACT(node)) {
+ target = (GaimContact*)node;
+ prev = gaim_blist_get_last_child(node);
+ } else if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
+ target = (GaimContact*)node->parent;
+ prev = node;
+ } else {
return;
+ }
- child = sourcenode->child;
+ if(source == target || !target)
+ return;
- while(child) {
- child2 = child;
- child = child->next;
- if(GAIM_BLIST_NODE_IS_BUDDY(child2))
- gaim_blist_add_buddy((GaimBuddy*)child2, target, NULL,
- gaim_blist_get_last_child(targetnode));
+ targetnode = (GaimBlistNode*)target;
+ next = sourcenode->child;
+
+ while(next) {
+ cur = next;
+ next = cur->next;
+ if(GAIM_BLIST_NODE_IS_BUDDY(cur)) {
+ gaim_blist_add_buddy((GaimBuddy*)cur, target, NULL, prev);
+ prev = cur;
+ }
}
}
Index: blist.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/blist.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -p -r1.37 -r1.38
--- blist.h 2 Oct 2003 05:26:40 -0000 1.37
+++ blist.h 13 Oct 2003 03:48:36 -0000 1.38
@@ -438,9 +438,9 @@ void gaim_blist_add_contact(GaimContact
* All of the buddies from source will be moved to target
*
* @param source The contact to merge
- * @param target The contact to be merged into
+ * @param node The place to merge to (a buddy or contact)
*/
-void gaim_blist_merge_contact(GaimContact *source, GaimContact *target);
+void gaim_blist_merge_contact(GaimContact *source, GaimBlistNode *node);
/**
* Returns the highest priority buddy for a given contact.
Index: gtkblist.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/gtkblist.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -p -r1.110 -r1.111
--- gtkblist.c 13 Oct 2003 00:11:48 -0000 1.110
+++ gtkblist.c 13 Oct 2003 03:48:36 -0000 1.111
@@ -801,7 +801,7 @@ static void gaim_gtk_blist_drag_data_rcv
if (GAIM_BLIST_NODE_IS_CONTACT(n)) {
GaimContact *c = (GaimContact*)n;
if (GAIM_BLIST_NODE_IS_CONTACT(node) && gtknode->contact_expanded) {
- gaim_blist_merge_contact(c, (GaimContact*)node);
+ gaim_blist_merge_contact(c, node);
} else if (GAIM_BLIST_NODE_IS_CONTACT(node) ||
GAIM_BLIST_NODE_IS_CHAT(node)) {
switch(position) {
@@ -819,7 +819,7 @@ static void gaim_gtk_blist_drag_data_rcv
} else if(GAIM_BLIST_NODE_IS_GROUP(node)) {
gaim_blist_add_contact(c, (GaimGroup*)node, NULL);
} else if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
- gaim_blist_merge_contact(c, (GaimContact*)node->parent);
+ gaim_blist_merge_contact(c, node);
}
} else if (GAIM_BLIST_NODE_IS_BUDDY(n)) {
GaimBuddy *b = (GaimBuddy*)n;
@@ -2607,8 +2607,10 @@ add_buddy_cb(GtkWidget *w, int resp, Gai
gaim_blist_add_buddy(b, NULL, g, NULL);
serv_add_buddy(gaim_account_get_connection(data->account), who, g);
- if (c != NULL)
+ if (c != NULL) {
gaim_buddy_icon_update(gaim_conv_im_get_icon(GAIM_CONV_IM(c)));
+ gaim_conversation_update(c, GAIM_CONV_UPDATE_ADD);
+ }
gaim_blist_save();
}
|