# HG changeset patch # User Nathan Walp # Date 1064460607 0 # Node ID d4b4229bcd21f227ef7b83ddb0baab2c2c17d8f1 # Parent 88207c8a4b20b1193040fef01fb9df597a028291 [gaim-migrate @ 7512] fix sort by log size and sort by status, and allow dragging of entire contacts into expanded contacts, like one would expect committer: Tailor Script diff -r 88207c8a4b20 -r d4b4229bcd21 src/blist.c --- a/src/blist.c Thu Sep 25 02:24:35 2003 +0000 +++ b/src/blist.c Thu Sep 25 03:30:07 2003 +0000 @@ -886,6 +886,26 @@ gaim_blist_save(); } +void gaim_blist_merge_contact(GaimContact *source, GaimContact *target) +{ + GaimBlistNode *sourcenode = (GaimBlistNode*)source; + GaimBlistNode *targetnode = (GaimBlistNode*)target; + GaimBlistNode *child, *child2; + + if(source == target) + 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)); + } +} + void gaim_blist_add_group (GaimGroup *group, GaimBlistNode *node) { struct gaim_blist_ui_ops *ops; diff -r 88207c8a4b20 -r d4b4229bcd21 src/blist.h --- a/src/blist.h Thu Sep 25 02:24:35 2003 +0000 +++ b/src/blist.h Thu Sep 25 03:30:07 2003 +0000 @@ -424,6 +424,16 @@ void gaim_blist_add_contact(GaimContact *contact, GaimGroup *group, GaimBlistNode *node); /** + * Merges two contacts + * + * 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 + */ +void gaim_blist_merge_contact(GaimContact *source, GaimContact *target); + +/** * Returns the highest priority buddy for a given contact. * * @param contact The contact