diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-07-31 17:57:57 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-07-31 17:57:57 +0800 |
commit | 322b2c1d303d41d1914dfa8f1eb3d682be76690f (patch) | |
tree | d8ad1bd6ca0e2ea77ce8bc93c75ad1d3d123d225 | |
parent | 731e83ac7fdef0f6b6e180d48a3f00dd1ba8a02a (diff) | |
download | gsoc2013-evolution-322b2c1d303d41d1914dfa8f1eb3d682be76690f.tar.gz gsoc2013-evolution-322b2c1d303d41d1914dfa8f1eb3d682be76690f.tar.zst gsoc2013-evolution-322b2c1d303d41d1914dfa8f1eb3d682be76690f.zip |
Fixes #310489
svn path=/trunk/; revision=32448
-rw-r--r-- | plugins/mail-to-task/ChangeLog | 10 | ||||
-rw-r--r-- | plugins/mail-to-task/mail-to-task.c | 29 |
2 files changed, 35 insertions, 4 deletions
diff --git a/plugins/mail-to-task/ChangeLog b/plugins/mail-to-task/ChangeLog index c9ecbda484..9932a96c1f 100644 --- a/plugins/mail-to-task/ChangeLog +++ b/plugins/mail-to-task/ChangeLog @@ -1,3 +1,13 @@ +2006-07-31 Chenthill Palanisamy <pchenthill@novell.com> + + Fixes #310489 + * mail-to-task.c: + (set_attendees): + (set_organizer): Appended the mailto field + to the email values. + (do_mail_to_task):Set the ICAL_X parameter + so that no mail is sent to the recipients. + 2006-06-06 Hiroyuki Ikezoe <poincare@ikezoe.net> Fixes #332605. diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index ebb3bde165..9b3d18e7fd 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -59,7 +59,7 @@ clean_name(const unsigned char *s) static void set_attendees (ECalComponent *comp, CamelMimeMessage *message) { - GSList *attendees = NULL, *l; + GSList *attendees = NULL, *l, *to_free = NULL; ECalComponentAttendee *ca; const CamelInternetAddress *to, *cc, *bcc, *arr[3]; int len, i, j; @@ -77,8 +77,14 @@ set_attendees (ECalComponent *comp, CamelMimeMessage *message) const char *name, *addr; if (camel_internet_address_get (arr[j], i, &name, &addr)) { + char *temp; + ca = g_new0 (ECalComponentAttendee, 1); - ca->value = addr; + + temp = g_strconcat ("mailto:", addr, NULL); + ca->value = temp; + to_free = g_slist_prepend (to_free, temp); + ca->cn = name; /* FIXME: missing many fields */ @@ -92,6 +98,9 @@ set_attendees (ECalComponent *comp, CamelMimeMessage *message) for (l = attendees; l != NULL; l = l->next) g_free (l->data); + g_slist_foreach (to_free, (GFunc) g_free, NULL); + + g_slist_free (to_free); g_slist_free (attendees); } @@ -161,6 +170,7 @@ set_organizer (ECalComponent *comp, CamelMimeMessage *message) const CamelInternetAddress *address; const char *str, *name; ECalComponentOrganizer organizer = {NULL, NULL, NULL, NULL}; + char *temp; if (message->reply_to) address = message->reply_to; @@ -172,9 +182,12 @@ set_organizer (ECalComponent *comp, CamelMimeMessage *message) if (!camel_internet_address_get (address, 0, &name, &str)) return; - organizer.value = str; + temp = g_strconcat ("mailto:", str, NULL); + organizer.value = temp; organizer.cn = name; e_cal_component_set_organizer (comp, &organizer); + + g_free (temp); } static void @@ -246,6 +259,8 @@ do_mail_to_task (AsyncData *data) CamelMimeMessage *message; ECalComponent *comp; ECalComponentText text; + icalproperty *icalprop; + icalcomponent *icalcomp; /* retrieve the message from the CamelFolder */ message = camel_folder_get_message (folder, g_ptr_array_index (uids, i), NULL); @@ -270,8 +285,14 @@ do_mail_to_task (AsyncData *data) /* set attachment files */ set_attachments (client, comp, message); + icalcomp = e_cal_component_get_icalcomponent (comp); + + icalprop = icalproperty_new_x ("1"); + icalproperty_set_x_name (icalprop, "X-EVOLUTION-MOVE-CALENDAR"); + icalcomponent_add_property (icalcomp, icalprop); + /* save the task to the selected source */ - e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), NULL, NULL); + e_cal_create_object (client, icalcomp, NULL, NULL); g_object_unref (comp); } |