[evolution] Bug #603480 - [bbdb] Traverse lists in destinations properly



commit a26fc50120fbe6ebbe8642d7ddb84e4c08d5c14a
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jan 19 16:39:31 2010 +0100

    Bug #603480 - [bbdb] Traverse lists in destinations properly

 plugins/bbdb/bbdb.c |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c
index d9b1967..f48745a 100644
--- a/plugins/bbdb/bbdb.c
+++ b/plugins/bbdb/bbdb.c
@@ -268,19 +268,35 @@ bbdb_do_thread (const gchar *name, const gchar *email)
 static void
 walk_destinations_and_free (EDestination **dests)
 {
+	const gchar *name, *addr;
 	gint i;
 
 	if (!dests)
 		return;
 
 	for (i = 0; dests[i] != NULL; i++) {
-		const gchar *name, *addr;
+		if (e_destination_is_evolution_list (dests[i])) {
+			const GList *members;
 
-		name = e_destination_get_name (dests[i]);
-		addr = e_destination_get_email (dests[i]);
+			for (members = e_destination_list_get_dests (dests[i]); members; members = members->next) {
+				const EDestination *member = members->data;
 
-		if (name || addr)
-			bbdb_do_thread (name, addr);
+				if (!member)
+					continue;
+
+				name = e_destination_get_name (member);
+				addr = e_destination_get_email (member);
+
+				if (name || addr)
+					bbdb_do_thread (name, addr);
+			}
+		} else {
+			name = e_destination_get_name (dests[i]);
+			addr = e_destination_get_email (dests[i]);
+
+			if (name || addr)
+				bbdb_do_thread (name, addr);
+		}
 	}
 
 	e_destination_freev (dests);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]