diff options
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index dee9791098..0fc6596f88 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -30,10 +30,12 @@ #endif #include <errno.h> +#include <time.h> #include <libgnome/gnome-paper.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> #include <libgnomeui/gnome-stock.h> +#include <libgnome/gnome-paper.h> #include <libgnomeprint/gnome-print-master.h> #include <libgnomeprint/gnome-print-master-preview.h> #include <gal/e-table/e-table.h> @@ -286,7 +288,7 @@ composer_sent_cb(char *uri, CamelMimeMessage *message, gboolean sent, void *data camel_object_unref (CAMEL_OBJECT (message)); } -CamelMimeMessage * +static CamelMimeMessage * composer_get_message (EMsgComposer *composer) { CamelMimeMessage *message; @@ -558,7 +560,7 @@ static EMsgComposer * mail_generate_reply (CamelMimeMessage *message, gboolean to_all) { const CamelInternetAddress *reply_to, *sender, *to_addrs, *cc_addrs; - const char *name = NULL, *address = NULL; + const char *name = NULL, *address = NULL, *source = NULL; const char *message_id, *references; char *text, *subject, *date_str; const MailConfigAccount *me = NULL; @@ -569,8 +571,11 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) gchar *sig_file = NULL; time_t date; int offset; + + source = camel_mime_message_get_source (message); + me = mail_config_get_account_by_source_url (source); - id = mail_config_get_default_identity (); + id = me ? me->id : mail_config_get_default_identity (); if (id) sig_file = id->signature; @@ -607,7 +612,7 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) if (to_all) { cc = list_add_addresses (cc, to_addrs, accounts, &me); cc = list_add_addresses (cc, cc_addrs, accounts, me ? NULL : &me); - } else { + } else if (me == NULL) { me = guess_me (to_addrs, cc_addrs, accounts); } |