aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-02-15 05:38:40 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-02-15 05:38:40 +0800
commite2fb2c92b5bc2cbce7e6b9294e55c9e23a8cc019 (patch)
treea2b385f11a3e8dbdb3fb539dea9496cb2f11cc52 /mail/mail-callbacks.c
parent24b63477d15ebd6bdc2cd47d3f63fb58c50b07cf (diff)
downloadgsoc2013-evolution-e2fb2c92b5bc2cbce7e6b9294e55c9e23a8cc019.tar.gz
gsoc2013-evolution-e2fb2c92b5bc2cbce7e6b9294e55c9e23a8cc019.tar.zst
gsoc2013-evolution-e2fb2c92b5bc2cbce7e6b9294e55c9e23a8cc019.zip
Default the from-account to the source account. If that fails, then guess
2002-02-14 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (mail_generate_reply): Default the from-account to the source account. If that fails, then guess the from-account based on the recipients. Fixes bug #20479. svn path=/trunk/; revision=15728
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 0c10521ad9..fa59e0e254 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -886,7 +886,12 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
cc_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC);
mail_ignore_address (composer, to_addrs);
mail_ignore_address (composer, cc_addrs);
-
+
+ /* default 'me' to the source account... */
+ source = camel_mime_message_get_source (message);
+ if (source)
+ me = mail_config_get_account_by_source_url (source);
+
if (mode == REPLY_LIST) {
CamelMessageInfo *info;
const char *mlist;
@@ -928,7 +933,8 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
}
}
- me = guess_me (to_addrs, cc_addrs, accounts);
+ if (!me)
+ me = guess_me (to_addrs, cc_addrs, accounts);
} else {
GHashTable *rcpt_hash;
@@ -954,10 +960,11 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
}
if (mode == REPLY_ALL) {
- cc = list_add_addresses (cc, to_addrs, accounts, rcpt_hash, &me);
+ cc = list_add_addresses (cc, to_addrs, accounts, rcpt_hash, me ? NULL : &me);
cc = list_add_addresses (cc, cc_addrs, accounts, rcpt_hash, me ? NULL : &me);
} else {
- me = guess_me (to_addrs, cc_addrs, accounts);
+ if (!me)
+ me = guess_me (to_addrs, cc_addrs, accounts);
}
g_hash_table_destroy (rcpt_hash);
@@ -971,7 +978,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
} else {
name = _("an unknown sender");
}
-
+
date = camel_mime_message_get_date (message, NULL);
strftime (date_str, sizeof (date_str), _("On %a, %Y-%m-%d at %H:%M, %%s wrote:"),
localtime (&date));
@@ -984,13 +991,6 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
g_free (text);
}
}
-
- if (me == NULL) {
- /* as a last resort, set the replying account (aka me)
- to the account this was fetched from */
- source = camel_mime_message_get_source (message);
- me = mail_config_get_account_by_source_url (source);
- }
/* Set the subject of the new message. */
subject = (char *)camel_mime_message_get_subject (message);
@@ -1048,7 +1048,7 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char
} else if (references) {
e_msg_composer_add_header (composer, "References", references);
}
-
+
e_msg_composer_drop_editor_undo (composer);
return composer;