From c874c06ba815dd05153ba57064385ec473b1b07e Mon Sep 17 00:00:00 2001 From: Dave West Date: Wed, 30 Jan 2002 00:33:34 +0000 Subject: Changed the function signature so that we can pass in whom we want to 2002-01-29 Dave West * mail-callbacks.c (create_msg_composer): Changed the function signature so that we can pass in whom we want to compose as. Should fix bug #10391. (compose_msg): Get the current profile account and pass it along to create_msg_composer. (send_to_url): Pass in a NULL profile account to cause create_msg_composer to use the default account. svn path=/trunk/; revision=15518 --- mail/ChangeLog | 10 ++++++++++ mail/mail-callbacks.c | 23 +++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 0775114de0..02144c733f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2002-01-29 Dave West + + * mail-callbacks.c (create_msg_composer): Changed the function + signature so that we can pass in whom we want to compose as. + Should fix bug #10391. + (compose_msg): Get the current profile account and pass it along + to create_msg_composer. + (send_to_url): Pass in a NULL profile account to cause + create_msg_composer to use the default account. + 2002-01-29 Jeffrey Stedfast * mail-ops.c (mail_send_message): Make X-Evolution-Account take diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 1a3cb3cedc..bd1a243a22 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -411,6 +411,7 @@ 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); @@ -693,15 +694,20 @@ composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer data) } static GtkWidget * -create_msg_composer (const char *url) +create_msg_composer (const MailConfigAccount *account, const char *url) { - const MailConfigAccount *account; gboolean send_html; EMsgComposer *composer; - account = mail_config_get_default_account (); + /* Make sure that we've actually been passed in an account. If one has + * not been passed in, grab the default account. + */ + if (account == NULL) { + account = mail_config_get_default_account (); + } + send_html = mail_config_get_send_html (); - + composer = url ? e_msg_composer_new_from_url (url) : e_msg_composer_new (); if (composer) { @@ -716,13 +722,17 @@ create_msg_composer (const char *url) void compose_msg (GtkWidget *widget, gpointer user_data) { + MailConfigAccount *account; FolderBrowser *fb = FOLDER_BROWSER (user_data); GtkWidget *composer; if (FOLDER_BROWSER_IS_DESTROYED (fb) || !check_send_configuration (fb)) return; - composer = create_msg_composer (NULL); + /* Figure out which account we want to initially compose from */ + account = mail_config_get_account_by_source_url (fb->uri); + + composer = create_msg_composer (account, NULL); if (!composer) return; @@ -747,7 +757,8 @@ send_to_url (const char *url) if (!check_send_configuration (NULL)) return; - composer = create_msg_composer (url); + /* Tell create_msg_composer to use the default email profile */ + composer = create_msg_composer (NULL, url); if (!composer) return; -- cgit v1.2.3