aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMubeen Jukaku <jmubeen@novell.com>2005-11-11 17:59:43 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-11-11 17:59:43 +0800
commit32071d63a4f23bd1063331d43859463e6d53e93f (patch)
tree2587fde6830f35f0d6ae99226c53f9dc8b79a6b0
parentf891e4617e6a4930fca627ed1fd8b9c3256f9548 (diff)
downloadgsoc2013-evolution-32071d63a4f23bd1063331d43859463e6d53e93f.tar.gz
gsoc2013-evolution-32071d63a4f23bd1063331d43859463e6d53e93f.tar.zst
gsoc2013-evolution-32071d63a4f23bd1063331d43859463e6d53e93f.zip
Re-implemented this funciton. (add_attendee_cb): Removed this callback
2005-10-11 Mubeen Jukaku <jmubeen@novell.com> * mail-to-task.c (set_attendees): Re-implemented this funciton. (add_attendee_cb): Removed this callback because of above change. Fixes bug #301081 svn path=/trunk/; revision=30600
-rw-r--r--plugins/mail-to-task/ChangeLog7
-rw-r--r--plugins/mail-to-task/mail-to-task.c40
2 files changed, 31 insertions, 16 deletions
diff --git a/plugins/mail-to-task/ChangeLog b/plugins/mail-to-task/ChangeLog
index c74542ec21..705ba4a4d2 100644
--- a/plugins/mail-to-task/ChangeLog
+++ b/plugins/mail-to-task/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-11 Mubeen Jukaku <jmubeen@novell.com>
+
+ * mail-to-task.c (set_attendees): Re-implemented this funciton.
+ (add_attendee_cb): Removed this callback because of above change.
+
+ Fixes bug #301081
+
2005-10-03 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #315752
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 462ae04231..ba277fc7a8 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -32,33 +32,41 @@ typedef struct {
}AsyncData;
static void
-add_attendee_cb (gpointer key, gpointer value, gpointer user_data)
+set_attendees (ECalComponent *comp, CamelMimeMessage *message)
{
+ GSList *attendees = NULL, *l;
ECalComponentAttendee *ca;
- const char *str, *name;
- GSList **attendees = user_data;
+ const CamelInternetAddress *to, *cc, *bcc, *arr[3];
+ int len, i, j;
- if (!camel_internet_address_get (value, 0, &name, &str))
- return;
+ to = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
+ cc = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC);
+ bcc = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_BCC);
- ca = g_new0 (ECalComponentAttendee, 1);
- ca->value = str;
- ca->cn = name;
- /* FIXME: missing many fields */
+ arr[0] = to, arr[1] = cc, arr[2] = bcc;
- *attendees = g_slist_append (*attendees, ca);
-}
+ for(j = 0; j < 3; j++)
+ {
+ len = CAMEL_ADDRESS (arr[j])->addresses->len;
+ for (i = 0; i < len; i++) {
+ const char *name, *addr;
-static void
-set_attendees (ECalComponent *comp, CamelMimeMessage *message)
-{
- GSList *attendees = NULL, *l;
+ if (camel_internet_address_get (arr[j], i, &name, &addr)) {
+ ca = g_new0 (ECalComponentAttendee, 1);
+ ca->value = addr;
+ ca->cn = name;
+ /* FIXME: missing many fields */
+
+ attendees = g_slist_append (attendees, ca);
+ }
+ }
+ }
- g_hash_table_foreach (message->recipients, (GHFunc) add_attendee_cb, &attendees);
e_cal_component_set_attendee_list (comp, attendees);
for (l = attendees; l != NULL; l = l->next)
g_free (l->data);
+
g_slist_free (attendees);
}