diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-29 06:42:53 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-29 06:42:53 +0800 |
commit | 22127dc16ca6f456c468c7290b371e32fbd65b98 (patch) | |
tree | 4fd483164f5a7afa8f104f52fe5a8def3bf07041 | |
parent | e11f08d0481797a215c5b1837a4cc18003dd082d (diff) | |
download | gsoc2013-evolution-22127dc16ca6f456c468c7290b371e32fbd65b98.tar.gz gsoc2013-evolution-22127dc16ca6f456c468c7290b371e32fbd65b98.tar.zst gsoc2013-evolution-22127dc16ca6f456c468c7290b371e32fbd65b98.zip |
update for Camel recipient changes. (Just to make it build, not to take
advantage of new features, or do things cleanly.)
svn path=/trunk/; revision=2677
-rw-r--r-- | composer/ChangeLog | 5 | ||||
-rw-r--r-- | composer/e-msg-composer-hdrs.c | 7 | ||||
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-format.c | 49 |
4 files changed, 48 insertions, 19 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 87229237fd..470f00fc06 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,8 @@ +2000-04-28 Dan Winship <danw@helixcode.com> + + * e-msg-composer-hdrs.c (set_recipients): Update (minimally) for + Camel recipient changes. + 2000-04-27 Dan Winship <danw@helixcode.com> * e-msg-composer.c (e_msg_composer_new_from_url): New routine, to diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index e69c15efae..fb6d5adf3f 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -249,6 +249,7 @@ set_recipients (CamelMimeMessage *msg, EMsgComposerAddressEntry *entry; GList *list; GList *p; + struct _header_address *addr; entry = E_MSG_COMPOSER_ADDRESS_ENTRY (entry_widget); list = e_msg_composer_address_entry_get_addresses (entry); @@ -256,8 +257,10 @@ set_recipients (CamelMimeMessage *msg, /* FIXME leak? */ for (p = list; p != NULL; p = p->next) { - printf ("Adding `%s:' header: %s\n", type, (gchar *) p->data); - camel_mime_message_add_recipient (msg, type, (gchar *) p->data); + addr = header_address_decode (p->data); + camel_mime_message_add_recipient (msg, type, addr->name, + addr->v.addr); + header_address_unref (addr); } g_list_free (list); diff --git a/mail/ChangeLog b/mail/ChangeLog index b8c18f3731..baac4be710 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2000-04-28 Dan Winship <danw@helixcode.com> + + * mail-format.c (write_recipients_to_stream, write_headers, + mail_generate_reply): Update (minimally) for Camel recipient + changes. + 2000-04-28 Ettore Perazzoli <ettore@helixcode.com> * main.c (init_bonobo): Don't call `init_corba()' and don't get diff --git a/mail/mail-format.c b/mail/mail-format.c index 9e6e2cc785..b9689394d0 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -370,22 +370,24 @@ write_field_to_stream (const char *description, const char *value, static void write_recipients_to_stream (const gchar *recipient_type, - const GList *recipients, gboolean bold, - GtkHTML *html, + const CamelInternetAddress *recipients, + gboolean bold, GtkHTML *html, GtkHTMLStreamHandle *stream) { - gchar *recipients_string = NULL; + int i; + char *recipients_string = NULL; + const char *name, *addr; - while (recipients) { - gchar *old_string = recipients_string; + i = 0; + while (camel_internet_address_get (recipients, i++, &name, &addr)) { + char *old_string = recipients_string; recipients_string = - g_strdup_printf ("%s%s%s", + g_strdup_printf ("%s%s%s%s%s <%s>", old_string ? old_string : "", - old_string ? "; " : "", - (gchar *)recipients->data); + old_string ? ", " : "", + *name ? "\"" : "", name, + *name ? "\"" : "", addr); g_free (old_string); - - recipients = recipients->next; } write_field_to_stream (recipient_type, recipients_string, @@ -398,7 +400,7 @@ write_recipients_to_stream (const gchar *recipient_type, static void write_headers (CamelMimeMessage *mime_message, GtkBox *box) { - const GList *recipients; + const CamelInternetAddress *recipients; GtkHTML *html; GtkHTMLStreamHandle *stream; @@ -856,10 +858,14 @@ find_preferred_alternative (CamelMultipart *multipart) nparts = camel_multipart_get_number (multipart); for (i = 0; i < nparts; i++) { CamelMimePart *part = camel_multipart_get_part (multipart, i); + char *mime_type = gmime_content_field_get_mime_type ( + camel_mime_part_get_content_type (part)); - if (lookup_handler (part, &generic) && + g_strdown (mime_type); + if (lookup_handler (mime_type, &generic) && (!preferred_part || !generic)) preferred_part = part; + g_free (mime_type); } return preferred_part; @@ -1233,17 +1239,26 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) to = g_list_append (NULL, (gpointer)repl_to); if (to_all) { - const GList *recip; + const CamelInternetAddress *recip; + const char *name, *addr; + char *fulladdr; + int i; recip = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); - cc = g_list_copy ((GList*)recip); + i = 0; + cc = NULL; + while (camel_internet_address_get (recip, i++, &name, &addr)) { + fulladdr = g_strdup_printf ("%s <%s>", name, addr); + cc = g_list_append (cc, fulladdr); + } recip = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); - while (recip) { - cc = g_list_append (cc, recip->data); - recip = recip->next; + i = 0; + while (camel_internet_address_get (recip, i++, &name, &addr)) { + fulladdr = g_strdup_printf ("%s <%s>", name, addr); + cc = g_list_append (cc, fulladdr); } } else cc = NULL; |