changeset 6965:d4b4229bcd21

[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 <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 25 Sep 2003 03:30:07 +0000
parents 88207c8a4b20
children 7fd4b2cdb1c1
files src/blist.c src/blist.h
diffstat 2 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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