diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 40 | ||||
-rw-r--r-- | mail/mail-callbacks.h | 3 |
3 files changed, 32 insertions, 18 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 614118a8ee..7132fc1cf0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2002-01-31 Not Zed <NotZed@Ximian.com> + + * mail-callbacks.c (mail_generate_reply): Add attachments after + we've seen if the composer object is valid. + (mail_generate_reply): Support new flag REPLY_NO_QUOTE - if set, + then dont quote any of the message in the reply. + 2002-02-02 Ettore Perazzoli <ettore@ximian.com> * mail-account-gui.c (mail_account_gui_new): Destroy the S/MIME diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 7ed137e9e0..4b54798044 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -870,27 +870,33 @@ mail_generate_reply (CamelFolder *folder, CamelMimeMessage *message, const char time_t date; const int max_subject_length = 1024; - composer = e_msg_composer_new (); - e_msg_composer_add_message_attachments (composer, message, TRUE); - + composer = e_msg_composer_new (); if (!composer) return NULL; - sender = camel_mime_message_get_from (message); - if (sender != NULL && camel_address_length (CAMEL_ADDRESS (sender)) > 0) { - camel_internet_address_get (sender, 0, &name, &address); - } else { - name = _("an unknown sender"); - } - - date = camel_mime_message_get_date (message, NULL); + e_msg_composer_add_message_attachments (composer, message, TRUE); + + if ((mode & REPLY_NO_QUOTE) == 0) { + sender = camel_mime_message_get_from (message); + if (sender != NULL && camel_address_length (CAMEL_ADDRESS (sender)) > 0) { + camel_internet_address_get (sender, 0, &name, &address); + } 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)); + format = e_utf8_from_locale_string (date_str); + text = mail_tool_quote_message (message, format, name && *name ? name : address); + mail_ignore (composer, name, address); + g_free (format); - strftime (date_str, sizeof (date_str), _("On %a, %Y-%m-%d at %H:%M, %%s wrote:"), - localtime (&date)); - format = e_utf8_from_locale_string (date_str); - text = mail_tool_quote_message (message, format, name && *name ? name : address); - mail_ignore (composer, name, address); - g_free (format); + if (text) { + e_msg_composer_set_body_text (composer, text); + g_free (text); + } + } /* Set the recipients */ accounts = mail_config_get_accounts (); diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h index bd33a11ecf..3d14259c48 100644 --- a/mail/mail-callbacks.h +++ b/mail/mail-callbacks.h @@ -37,7 +37,8 @@ extern "C" { enum { REPLY_SENDER, REPLY_LIST, - REPLY_ALL + REPLY_ALL, + REPLY_NO_QUOTE = 0x80 /* dont quote reply */ }; void enumerate_msg (MessageList *ml, const char *uid, gpointer data); |