diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-03-19 14:11:59 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-03-19 14:11:59 +0800 |
commit | 2a9d6b7ad652d48a819555603b21d2c51fdfaa17 (patch) | |
tree | c8ff30500f36b5ffe246e58e5aafb5262f972c3a /mail/mail-callbacks.c | |
parent | 637fc55361690fa0c572a61e862b95f3535a75b3 (diff) | |
download | gsoc2013-evolution-2a9d6b7ad652d48a819555603b21d2c51fdfaa17.tar.gz gsoc2013-evolution-2a9d6b7ad652d48a819555603b21d2c51fdfaa17.tar.zst gsoc2013-evolution-2a9d6b7ad652d48a819555603b21d2c51fdfaa17.zip |
Add Resend Message menu item.
2001-03-19 Jeffrey Stedfast <fejj@ximian.com>
* folder-browser-factory.c: Add Resend Message menu item.
* folder-browser.c (on_right_click): Add resend to the right-click
menu.
* mail-callbacks.c (composer_sent_cb): Unref the message.
(composer_postpone_cb): Unref the message here too.
(resend_msg): New callback to allow resending of messages in the
Sent folder.
svn path=/trunk/; revision=8816
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index e97def949b..d764df5baf 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -377,6 +377,8 @@ composer_postpone_cb (EMsgComposer *composer, gpointer data) /* Save the message in Outbox */ mail_append_mail (outbox_folder, message, NULL, NULL, NULL); + camel_object_unref (CAMEL_OBJECT (message)); + if (psd) camel_folder_set_message_flags (psd->folder, psd->uid, psd->flags, psd->flags); @@ -1022,6 +1024,43 @@ edit_msg (GtkWidget *widget, gpointer user_data) } static void +do_resend_messages (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *data) +{ + const MailConfigAccount *account; + int i; + + account = mail_config_get_default_account (); + + for (i = 0; i < messages->len; i++) + mail_send_mail (account->transport->url, messages->pdata[i], NULL, NULL); +} + +void +resend_msg (GtkWidget *widget, gpointer user_data) +{ + FolderBrowser *fb = FOLDER_BROWSER (user_data); + extern CamelFolder *sent_folder; + GPtrArray *uids; + + if (fb->folder != sent_folder) { + GtkWidget *message; + + message = gnome_warning_dialog (_("You may only resend messages\n" + "in the Sent folder.")); + gnome_dialog_run_and_close (GNOME_DIALOG (message)); + return; + } + + if (!check_send_configuration (fb)) + return; + + uids = g_ptr_array_new (); + message_list_foreach (fb->message_list, enumerate_msg, uids); + + mail_get_messages (fb->folder, uids, do_resend_messages, fb); +} + +static void save_msg_ok (GtkWidget *widget, gpointer user_data) { CamelFolder *folder; |