diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-03-05 02:02:53 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-03-05 02:02:53 +0800 |
commit | d833e66982568e0d427b5827e97995b2c472328a (patch) | |
tree | a22b62d5af8dc5e9f02a48860bd64056710521a8 /mail/mail-callbacks.c | |
parent | e366ce662a05377da22830fe9548a4d1ae337fa3 (diff) | |
download | gsoc2013-evolution-d833e66982568e0d427b5827e97995b2c472328a.tar.gz gsoc2013-evolution-d833e66982568e0d427b5827e97995b2c472328a.tar.zst gsoc2013-evolution-d833e66982568e0d427b5827e97995b2c472328a.zip |
Go back to using e_destination_get_address() but use the camel-address
2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (composer_get_message): Go back to using
e_destination_get_address() but use the camel-address parser on
the strings to make sure they are non-empty. Fixes bug #37854.
svn path=/trunk/; revision=20137
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 14e21e7d46..a16f5527c3 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -407,6 +407,7 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ CamelMimeMessage *message = NULL; EDestination **recipients, **recipients_bcc; gboolean send_html, confirm_html; + CamelInternetAddress *cia; int hidden = 0, shown = 0; int num = 0, num_bcc = 0; GConfClient *gconf; @@ -423,18 +424,24 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ /* get the message recipients */ recipients = e_msg_composer_get_recipients (composer); + cia = camel_internet_address_new (); + /* see which ones are visible/present, etc */ if (recipients) { for (i = 0; recipients[i] != NULL; i++) { - const char *addr = e_destination_get_email (recipients[i]); + const char *addr = e_destination_get_address (recipients[i]); if (addr && addr[0]) { - num++; - if (e_destination_is_evolution_list (recipients[i]) - && !e_destination_list_show_addresses (recipients[i])) { - hidden++; - } else { - shown++; + camel_address_decode ((CamelAddress *) cia, addr); + if (camel_address_length ((CamelAddress *) cia) > 0) { + camel_address_remove ((CamelAddress *) cia, -1); + num++; + if (e_destination_is_evolution_list (recipients[i]) + && !e_destination_list_show_addresses (recipients[i])) { + hidden++; + } else { + shown++; + } } } } @@ -443,15 +450,22 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ recipients_bcc = e_msg_composer_get_bcc (composer); if (recipients_bcc) { for (i = 0; recipients_bcc[i] != NULL; i++) { - const char *addr = e_destination_get_email (recipients_bcc[i]); + const char *addr = e_destination_get_address (recipients_bcc[i]); - if (addr && addr[0]) - num_bcc++; + if (addr && addr[0]) { + camel_address_decode ((CamelAddress *) cia, addr); + if (camel_address_length ((CamelAddress *) cia) > 0) { + camel_address_remove ((CamelAddress *) cia, -1); + num_bcc++; + } + } } e_destination_freev (recipients_bcc); } + camel_object_unref (cia); + /* I'm sensing a lack of love, er, I mean recipients. */ if (num == 0 && !post) { e_notice ((GtkWindow *) composer, GTK_MESSAGE_WARNING, |