From 7158b3b00ac2e6293bbbcb36985280cf1a617590 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 1 Nov 2000 23:39:09 +0000 Subject: Don't create the To, Cc, and Bcc lists based only on the address, use both 2000-11-01 Jeffrey Stedfast * e-msg-composer.c (e_msg_composer_new_with_message): Don't create the To, Cc, and Bcc lists based only on the address, use both the name and address and camel_address_encode() them. svn path=/trunk/; revision=6326 --- composer/ChangeLog | 6 ++++++ composer/e-msg-composer.c | 36 +++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index b8991e1a98..da653450c2 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2000-11-01 Jeffrey Stedfast + + * e-msg-composer.c (e_msg_composer_new_with_message): Don't create + the To, Cc, and Bcc lists based only on the address, use both the + name and address and camel_address_encode() them. + 2000-11-01 Jeffrey Stedfast * e-msg-composer-attachment-bar.c (attach_to_multipart): Fix the diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 28b9eb7fac..59cdf40a38 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1447,26 +1447,44 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg) len = CAMEL_ADDRESS (to)->addresses->len; for (i = 0; i < len; i++) { - const char *addr; + const char *name, *addr; - if (camel_internet_address_get (to, i, NULL, &addr)) - To = g_list_append (To, g_strdup (addr)); + if (camel_internet_address_get (to, i, &name, &addr)) { + CamelInternetAddress *cia; + + cia = camel_internet_address_new (); + camel_internet_address_add (cia, name, addr); + To = g_list_append (To, camel_address_encode (CAMEL_ADDRESS (cia))); + camel_object_unref (CAMEL_OBJECT (cia)); + } } len = CAMEL_ADDRESS (cc)->addresses->len; for (i = 0; i < len; i++) { - const char *addr; + const char *name, *addr; - if (camel_internet_address_get (cc, i, NULL, &addr)) - Cc = g_list_append (Cc, g_strdup (addr)); + if (camel_internet_address_get (to, i, &name, &addr)) { + CamelInternetAddress *cia; + + cia = camel_internet_address_new (); + camel_internet_address_add (cia, name, addr); + Cc = g_list_append (Cc, camel_address_encode (CAMEL_ADDRESS (cia))); + camel_object_unref (CAMEL_OBJECT (cia)); + } } len = CAMEL_ADDRESS (bcc)->addresses->len; for (i = 0; i < len; i++) { - const char *addr; + const char *name, *addr; - if (camel_internet_address_get (bcc, i, NULL, &addr)) - Bcc = g_list_append (Bcc, g_strdup (addr)); + if (camel_internet_address_get (to, i, &name, &addr)) { + CamelInternetAddress *cia; + + cia = camel_internet_address_new (); + camel_internet_address_add (cia, name, addr); + Bcc = g_list_append (Bcc, camel_address_encode (CAMEL_ADDRESS (cia))); + camel_object_unref (CAMEL_OBJECT (cia)); + } } e_msg_composer_set_headers (new, To, Cc, Bcc, subject); -- cgit