diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/mail-format.c | 15 | ||||
-rw-r--r-- | mail/mail-ops.c | 17 | ||||
-rw-r--r-- | mail/mail.h | 7 |
4 files changed, 34 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 95e484aa8d..50b83ebf00 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,13 @@ 2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> + * mail-format.c (mail_get_message_body): Renamed from reply_body() + so other functions can use it + (mail_generate_reply): Updated to reflect function name changes + + * mail-ops.c (real_edit_msg): Attach a callback to the send signal + +2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> + * folder-browser-factory.c (control_activate): New menu item under Actions to allow editing of messages. diff --git a/mail/mail-format.c b/mail/mail-format.c index df09cace9c..dad21688f4 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -1557,9 +1557,8 @@ handle_via_external (CamelMimePart *part, const char *mime_type, return TRUE; } - -static char * -reply_body (CamelDataWrapper *data, gboolean want_plain, gboolean *is_html) +char * +mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean *is_html) { CamelMultipart *mp; CamelMimePart *subpart; @@ -1603,7 +1602,7 @@ reply_body (CamelDataWrapper *data, gboolean want_plain, gboolean *is_html) data = camel_medium_get_content_object ( CAMEL_MEDIUM (subpart)); - return reply_body (data, want_plain, is_html); + return mail_get_message_body (data, want_plain, is_html); } nparts = camel_multipart_get_number (mp); @@ -1622,7 +1621,7 @@ reply_body (CamelDataWrapper *data, gboolean want_plain, gboolean *is_html) data = camel_medium_get_content_object ( CAMEL_MEDIUM (subpart)); - subtext = reply_body (data, want_plain, is_html); + subtext = mail_get_message_body (data, want_plain, is_html); if (!subtext) continue; if (*is_html) { @@ -1661,10 +1660,10 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all) want_plain = !config->send_html; contents = camel_medium_get_content_object (CAMEL_MEDIUM (message)); - text = reply_body (contents, want_plain, &is_html); - + text = mail_get_message_body (contents, want_plain, &is_html); + composer = E_MSG_COMPOSER (e_msg_composer_new ()); - + /* Set the quoted reply text. */ if (text) { char *repl_text; diff --git a/mail/mail-ops.c b/mail/mail-ops.c index a7388a81e2..fd3500f250 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -630,12 +630,12 @@ void compose_msg (GtkWidget *widget, gpointer user_data) { GtkWidget *composer; - + if (!check_configured ()) return; - + composer = create_msg_composer (NULL); - + gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); gtk_widget_show (composer); @@ -854,6 +854,8 @@ real_edit_msg (MessageList *ml, const char *uid, gpointer user_data) msg = camel_folder_get_message (ml->folder, uid, ex); composer = e_msg_composer_new_with_message (msg); + gtk_signal_connect (GTK_OBJECT (composer), "send", + GTK_SIGNAL_FUNC (composer_send_cb), NULL); gtk_widget_show (composer); } @@ -863,8 +865,17 @@ edit_message (BonoboUIHandler *uih, void *user_data, const char *path) FolderBrowser *fb = FOLDER_BROWSER (user_data); MessageList *ml = fb->message_list; CamelException ex; + extern CamelFolder *drafts_folder; camel_exception_init (&ex); + + if (fb->folder != drafts_folder) { + camel_exception_setv (&ex, CAMEL_EXCEPTION_FOLDER_INSUFFICIENT_PERMISSION, + "FIXME: some error message about not being in the Drafts folder..."); + mail_exception_dialog ("Could not open message for editing", &ex, fb); + return; + } + message_list_foreach (ml, real_edit_msg, &ex); if (camel_exception_is_set (&ex)) { mail_exception_dialog ("Could not open message for editing", &ex, fb); diff --git a/mail/mail.h b/mail/mail.h index 3f5563c378..4643fc8be5 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -46,12 +46,15 @@ char *mail_crypto_openpgp_encrypt (const char *plaintext, /* mail-format */ void mail_format_mime_message (CamelMimeMessage *mime_message, - GtkHTML *html, GtkHTMLStream *stream, - CamelMimeMessage *root_message); + GtkHTML *html, GtkHTMLStream *stream, + CamelMimeMessage *root_message); EMsgComposer *mail_generate_reply (CamelMimeMessage *mime_message, gboolean to_all); +char *mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, + gboolean *is_html); + /* mail-identify */ char *mail_identify_mime_part (CamelMimePart *part); |