diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 1 | ||||
-rw-r--r-- | mail/folder-browser.c | 10 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 39 | ||||
-rw-r--r-- | mail/mail-callbacks.h | 1 |
5 files changed, 58 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index f6216c7198..428e7645b1 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,6 +1,14 @@ 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. 2001-03-18 Jeffrey Stedfast <fejj@ximian.com> diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index fabc658438..fce9956575 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -60,6 +60,7 @@ BonoboUIVerb verbs [] = { /* Message Menu */ BONOBO_UI_UNSAFE_VERB ("MessageOpen", open_message), + BONOBO_UI_UNSAFE_VERB ("MessageResend", resend_msg), BONOBO_UI_UNSAFE_VERB ("MessageSaveAs", save_msg), BONOBO_UI_UNSAFE_VERB ("MessagePrint", print_msg), BONOBO_UI_UNSAFE_VERB ("MessageReplySndr", reply_to_sender), diff --git a/mail/folder-browser.c b/mail/folder-browser.c index e9170b9148..6473df58a6 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -497,6 +497,7 @@ enum { CAN_DELETE = 16, CAN_UNDELETE = 32, IS_MAILING_LIST = 64, + CAN_RESEND = 128, }; #define SEPARATOR { "", NULL, (NULL), NULL, 0 } @@ -541,6 +542,8 @@ static EPopupMenu filter_menu[] = { static EPopupMenu menu[] = { { N_("Open"), NULL, GTK_SIGNAL_FUNC (open_msg), NULL, 0 }, + { N_("Resend"), NULL, + GTK_SIGNAL_FUNC (resend_msg), NULL, CAN_RESEND }, { N_("Save As..."), NULL, GTK_SIGNAL_FUNC (save_msg), NULL, 0 }, { N_("Print"), NULL, @@ -595,7 +598,7 @@ static EPopupMenu menu[] = { static gint on_right_click (ETable *table, gint row, gint col, GdkEvent *event, FolderBrowser *fb) { - extern CamelFolder *drafts_folder; + extern CamelFolder *sent_folder; CamelMessageInfo *info; GPtrArray *uids; int enable_mask = 0; @@ -609,6 +612,11 @@ on_right_click (ETable *table, gint row, gint col, GdkEvent *event, FolderBrowse goto display_menu; } + if (fb->folder != sent_folder) { + enable_mask |= CAN_RESEND; + hide_mask |= CAN_RESEND; + } + if (fb->mail_display->current_message == NULL) { enable_mask |= SELECTION_SET; mailing_list_name = NULL; 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; diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h index feee9a8045..d04e126d50 100644 --- a/mail/mail-callbacks.h +++ b/mail/mail-callbacks.h @@ -70,6 +70,7 @@ void view_msg (GtkWidget *widget, gpointer user_data); void view_source (GtkWidget *widget, gpointer user_data); void next_msg (GtkWidget *widget, gpointer user_data); void previous_msg (GtkWidget *widget, gpointer user_data); +void resend_msg (GtkWidget *widget, gpointer user_data); void select_all (BonoboUIComponent *uih, void *user_data, const char *path); void invert_selection (BonoboUIComponent *uih, void *user_data, const char *path); |