comparison src/blist.c @ 7246:cb6bf374c7ee

[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 <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 13 Oct 2003 03:48:36 +0000
parents 747b9e00ef60
children 1930e3d00ecd
comparison
equal deleted inserted replaced
7245:747b9e00ef60 7246:cb6bf374c7ee
900 900
901 if (save) 901 if (save)
902 gaim_blist_save(); 902 gaim_blist_save();
903 } 903 }
904 904
905 void gaim_blist_merge_contact(GaimContact *source, GaimContact *target) 905 void gaim_blist_merge_contact(GaimContact *source, GaimBlistNode *node)
906 { 906 {
907 GaimBlistNode *sourcenode = (GaimBlistNode*)source; 907 GaimBlistNode *sourcenode = (GaimBlistNode*)source;
908 GaimBlistNode *targetnode = (GaimBlistNode*)target; 908 GaimBlistNode *targetnode;
909 GaimBlistNode *child, *child2; 909 GaimBlistNode *prev, *cur, *next;
910 910 GaimContact *target;
911 if(source == target) 911
912 return; 912 if(GAIM_BLIST_NODE_IS_CONTACT(node)) {
913 913 target = (GaimContact*)node;
914 child = sourcenode->child; 914 prev = gaim_blist_get_last_child(node);
915 915 } else if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
916 while(child) { 916 target = (GaimContact*)node->parent;
917 child2 = child; 917 prev = node;
918 child = child->next; 918 } else {
919 if(GAIM_BLIST_NODE_IS_BUDDY(child2)) 919 return;
920 gaim_blist_add_buddy((GaimBuddy*)child2, target, NULL, 920 }
921 gaim_blist_get_last_child(targetnode)); 921
922 if(source == target || !target)
923 return;
924
925 targetnode = (GaimBlistNode*)target;
926 next = sourcenode->child;
927
928 while(next) {
929 cur = next;
930 next = cur->next;
931 if(GAIM_BLIST_NODE_IS_BUDDY(cur)) {
932 gaim_blist_add_buddy((GaimBuddy*)cur, target, NULL, prev);
933 prev = cur;
934 }
922 } 935 }
923 } 936 }
924 937
925 void gaim_blist_add_group (GaimGroup *group, GaimBlistNode *node) 938 void gaim_blist_add_group (GaimGroup *group, GaimBlistNode *node)
926 { 939 {