aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave West <kat@unleashed.org>2002-01-30 08:33:34 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-01-30 08:33:34 +0800
commitc874c06ba815dd05153ba57064385ec473b1b07e (patch)
treedbd149450aca021ed47f448c25a1d37838f63487
parent9588e204977f74b4de25c109cceeecd42c02d7b7 (diff)
downloadgsoc2013-evolution-c874c06ba815dd05153ba57064385ec473b1b07e.tar.gz
gsoc2013-evolution-c874c06ba815dd05153ba57064385ec473b1b07e.tar.zst
gsoc2013-evolution-c874c06ba815dd05153ba57064385ec473b1b07e.zip
Changed the function signature so that we can pass in whom we want to
2002-01-29 Dave West <kat@unleashed.org> * 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
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-callbacks.c23
2 files changed, 27 insertions, 6 deletions
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 <kat@unleashed.org>
+
+ * 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 <fejj@ximian.com>
* 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;