diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-12-20 08:35:40 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-12-20 08:35:40 +0800 |
commit | 34ea30a0d8b5efe1c03a1c93d4929ba51aa5c716 (patch) | |
tree | 8e49d2870b7de39db1aa6033f1796a054e1e2494 /mail/mail-callbacks.c | |
parent | 28d014efff13377bb743a69ba164f6476de71a8c (diff) | |
download | gsoc2013-evolution-34ea30a0d8b5efe1c03a1c93d4929ba51aa5c716.tar.gz gsoc2013-evolution-34ea30a0d8b5efe1c03a1c93d4929ba51aa5c716.tar.zst gsoc2013-evolution-34ea30a0d8b5efe1c03a1c93d4929ba51aa5c716.zip |
Add the auto-cc/bcc recipients here. The problem with setting them in the
2001-12-19 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (composer_get_message): Add the auto-cc/bcc
recipients here. The problem with setting them in the composer is
that what if the user changes which account he wants to use? We'd
either have to clear the cc/bcc lists *or* we'd have to leave them
alone. Either way is bad. We can't just clear the entries because
the user may have added addresses since the composer was
opened. We don't want to leave any old auto-cc/bcc addresses there
because that isn't desirable either. So we give up and add them
here after the user has already hit the send button.
* mail-config.c (account_copy): Update to copy the always-[b]cc
options.
(account_destroy): Update to destroy the above options.
(config_read): Update to read in those values.
(mail_config_write): Save those options.
* mail-account-gui.c (mail_account_gui_new): Setup Always Cc/Bcc
widgets.
(mail_account_gui_save): Get the user-entered values for the
always-cc/bcc stuff.
svn path=/trunk/; revision=15189
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 3f1baa452f..1c6a40609f 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -452,12 +452,45 @@ composer_get_message (EMsgComposer *composer) if (message == NULL) return NULL; + /* Add info about the sending account */ + account = e_msg_composer_get_preferred_account (composer); + if (account) { + camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Account", account->name); + camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", account->transport->url); + camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc", account->sent_folder_uri); + + /* add the always-cc/bcc addresses */ + if (account->always_cc && account->cc_addrs) { + CamelInternetAddress *addrs; + + addrs = camel_internet_address_new (); + camel_address_decode (CAMEL_ADDRESS (addrs), account->cc_addrs); + iaddr = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); + if (iaddr) + camel_address_cat (CAMEL_ADDRESS (addrs), CAMEL_ADDRESS (iaddr)); + camel_mime_message_set_recipients (message, CAMEL_RECIPIENT_TYPE_CC, addrs); + camel_object_unref (CAMEL_OBJECT (addrs)); + } + + if (account->always_bcc && account->bcc_addrs) { + CamelInternetAddress *addrs; + + addrs = camel_internet_address_new (); + camel_address_decode (CAMEL_ADDRESS (addrs), account->bcc_addrs); + iaddr = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_BCC); + if (iaddr) + camel_address_cat (CAMEL_ADDRESS (addrs), CAMEL_ADDRESS (iaddr)); + camel_mime_message_set_recipients (message, CAMEL_RECIPIENT_TYPE_BCC, addrs); + camel_object_unref (CAMEL_OBJECT (addrs)); + } + } + recipients = e_msg_composer_get_recipients (composer); /* Check for invalid recipients */ if (recipients) { gboolean have_invalid = FALSE; - gchar *msg, *new_msg; + char *msg, *new_msg; GtkWidget *message_box; for (i = 0; recipients[i] && !have_invalid; ++i) { @@ -524,7 +557,7 @@ composer_get_message (EMsgComposer *composer) so that it can present the user with a dialog whose text has been modified to reflect this situation. */ - const gchar *to_header = camel_medium_get_header (CAMEL_MEDIUM (message), CAMEL_RECIPIENT_TYPE_TO); + const char *to_header = camel_medium_get_header (CAMEL_MEDIUM (message), CAMEL_RECIPIENT_TYPE_TO); gboolean hidden_list_case = FALSE; if (to_header && !strcmp (to_header, "Undisclosed-Recipient:;")) @@ -569,14 +602,6 @@ composer_get_message (EMsgComposer *composer) } } - /* Add info about the sending account */ - account = e_msg_composer_get_preferred_account (composer); - if (account) { - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Account", account->name); - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Transport", account->transport->url); - camel_medium_set_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc", account->sent_folder_uri); - } - /* Get the message recipients and 'touch' them, boosting their use scores */ recipients = e_msg_composer_get_recipients (composer); e_destination_touchv (recipients); @@ -618,7 +643,7 @@ composer_send_cb (EMsgComposer *composer, gpointer data) send->composer = composer; gtk_object_ref (GTK_OBJECT (composer)); gtk_widget_hide (GTK_WIDGET (composer)); - e_msg_composer_set_enable_autosave(composer, FALSE); + e_msg_composer_set_enable_autosave (composer, FALSE); mail_send_mail (transport->url, message, composer_sent_cb, send); } @@ -639,6 +664,7 @@ composer_postpone_cb (EMsgComposer *composer, gpointer data) message = composer_get_message (composer); if (message == NULL) return; + info = camel_message_info_new (); info->flags = CAMEL_MESSAGE_SEEN; |