# HG changeset patch # User Nathan Walp # Date 1066016916 0 # Node ID cb6bf374c7ee4fb5ca9b8fd21d8c180a26ff4cd3 # Parent 747b9e00ef60e73e7355b37ef1e3ea3a816c4b69 [gaim-migrate @ 7823] 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 committer: Tailor Script diff -r 747b9e00ef60 -r cb6bf374c7ee src/blist.c --- a/src/blist.c Mon Oct 13 00:11:48 2003 +0000 +++ b/src/blist.c Mon Oct 13 03:48:36 2003 +0000 @@ -902,23 +902,36 @@ 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; - - if(source == target) + GaimBlistNode *targetnode; + GaimBlistNode *prev, *cur, *next; + GaimContact *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; - - 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)); + } + + if(source == target || !target) + return; + + 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; + } } } diff -r 747b9e00ef60 -r cb6bf374c7ee src/blist.h --- a/src/blist.h Mon Oct 13 00:11:48 2003 +0000 +++ b/src/blist.h Mon Oct 13 03:48:36 2003 +0000 @@ -438,9 +438,9 @@ * 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.