2007-01-03 [paul] 2.6.1cvs101

* src/compose.c
	* src/messageview.c
	* src/procmsg.c
	* src/procmsg.h
		When possible, use move_msg instead of
		copy_msg + remove_msg to move sent mail
		from Queue to Sent.
This commit is contained in:
Colin Leroy 2007-01-03 09:29:48 +00:00
parent 982a7be5c3
commit f29fa3c57e
7 changed files with 46 additions and 16 deletions

View file

@ -1,3 +1,13 @@
2007-01-03 [paul] 2.6.1cvs101
* src/compose.c
* src/messageview.c
* src/procmsg.c
* src/procmsg.h
When possible, use move_msg instead of
copy_msg + remove_msg to move sent mail
from Queue to Sent.
2007-01-03 [paul] 2.6.1cvs100
* src/html.c

View file

@ -2208,3 +2208,4 @@
( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 tools/maildir2claws-mail.pl; ) > 2.6.1cvs98.patchset
( cvs diff -u -r 1.1.2.36 -r 1.1.2.37 src/imap_gtk.c; ) > 2.6.1cvs99.patchset
( cvs diff -u -r 1.12.2.18 -r 1.12.2.19 src/html.c; ) > 2.6.1cvs100.patchset
( cvs diff -u -r 1.382.2.348 -r 1.382.2.349 src/compose.c; cvs diff -u -r 1.94.2.113 -r 1.94.2.114 src/messageview.c; cvs diff -u -r 1.150.2.86 -r 1.150.2.87 src/procmsg.c; cvs diff -u -r 1.60.2.37 -r 1.60.2.38 src/procmsg.h; ) > 2.6.1cvs101.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=6
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=100
EXTRA_VERSION=101
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -4279,6 +4279,7 @@ gint compose_send(Compose *compose)
gchar *errstr = NULL;
gchar *tmsgid = NULL;
MainWindow *mainwin = mainwindow_get_mainwindow();
gboolean queued_removed = FALSE;
if (prefs_common.send_dialog_mode != SEND_DIALOG_ALWAYS
|| compose->batch == TRUE)
@ -4341,10 +4342,10 @@ gint compose_send(Compose *compose)
}
if (msgpath == NULL) {
msgpath = folder_item_fetch_msg(folder, msgnum);
val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum);
val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum, &queued_removed);
g_free(msgpath);
} else {
val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum);
val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum, &queued_removed);
g_unlink(msgpath);
g_free(msgpath);
}
@ -4352,7 +4353,8 @@ gint compose_send(Compose *compose)
compose->sending = FALSE;
compose_allow_user_actions (compose, TRUE);
if (val != 0) {
folder_item_remove_msg(folder, msgnum);
if (!queued_removed)
folder_item_remove_msg(folder, msgnum);
folder_item_scan(folder);
if (tmsgid) {
/* make sure we delete that */
@ -4367,7 +4369,8 @@ gint compose_send(Compose *compose)
}
if (val == 0) {
folder_item_remove_msg(folder, msgnum);
if (!queued_removed)
folder_item_remove_msg(folder, msgnum);
folder_item_scan(folder);
if (tmsgid) {
/* make sure we delete that */

View file

@ -540,6 +540,8 @@ static gint disposition_notification_send(MsgInfo *msginfo)
gchar *addr;
gchar *addrp;
gchar *foo = NULL;
gboolean queued_removed = FALSE;
if (!msginfo->extradata)
return -1;
if (!msginfo->extradata->returnreceiptto &&
@ -721,10 +723,11 @@ static gint disposition_notification_send(MsgInfo *msginfo)
/* send it */
path = folder_item_fetch_msg(queue, num);
ok = procmsg_send_message_queue(path, &foo, queue, num);
ok = procmsg_send_message_queue(path, &foo, queue, num, &queued_removed);
g_free(path);
g_free(foo);
folder_item_remove_msg(queue, num);
if (ok == 0 && !queued_removed)
folder_item_remove_msg(queue, num);
return ok;
}

View file

@ -49,7 +49,7 @@
#include "inc.h"
static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr,
FolderItem *queue, gint msgnum);
FolderItem *queue, gint msgnum, gboolean *queued_removed);
enum
{
@ -950,15 +950,17 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, gchar **errstr)
if (!MSG_IS_LOCKED(msginfo->flags)) {
file = folder_item_fetch_msg(queue, msginfo->msgnum);
if (file) {
gboolean queued_removed = FALSE;
if (procmsg_send_message_queue_full(file,
!procmsg_is_last_for_account(queue, msginfo, elem),
errstr, queue, msginfo->msgnum) < 0) {
errstr, queue, msginfo->msgnum, &queued_removed) < 0) {
g_warning("Sending queued message %d failed.\n",
msginfo->msgnum);
err++;
} else {
sent++;
folder_item_remove_msg(queue, msginfo->msgnum);
if (!queued_removed)
folder_item_remove_msg(queue, msginfo->msgnum);
}
g_free(file);
}
@ -1465,7 +1467,7 @@ gint procmsg_cmp_msgnum_for_sort(gconstpointer a, gconstpointer b)
}
static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr,
FolderItem *queue, gint msgnum)
FolderItem *queue, gint msgnum, gboolean *queued_removed)
{
static HeaderEntry qentry[] = {{"S:", NULL, FALSE},
{"SSV:", NULL, FALSE},
@ -1754,15 +1756,25 @@ send_mail:
if (save_clear_text || tmp_enc_file == NULL) {
gboolean saved = FALSE;
*queued_removed = FALSE;
if (queue && msgnum > 0) {
MsgInfo *queued_mail = folder_item_get_msginfo(queue, msgnum);
if (folder_item_copy_msg(outbox, queued_mail) >= 0)
if (folder_item_move_msg(outbox, queued_mail) >= 0) {
debug_print("moved queued mail %d to sent folder\n", msgnum);
saved = TRUE;
*queued_removed = TRUE;
} else if (folder_item_copy_msg(outbox, queued_mail) >= 0) {
debug_print("copied queued mail %d to sent folder\n", msgnum);
saved = TRUE;
}
procmsg_msginfo_free(queued_mail);
}
if (!saved)
if (!saved) {
debug_print("resaving clear text queued mail to sent folder\n");
procmsg_save_to_outbox(outbox, file, TRUE);
}
} else {
debug_print("saving encrpyted queued mail to sent folder\n");
procmsg_save_to_outbox(outbox, tmp_enc_file, FALSE);
}
}
@ -1830,9 +1842,9 @@ send_mail:
return (newsval != 0 ? newsval : mailval);
}
gint procmsg_send_message_queue(const gchar *file, gchar **errstr, FolderItem *queue, gint msgnum)
gint procmsg_send_message_queue(const gchar *file, gchar **errstr, FolderItem *queue, gint msgnum, gboolean *queued_removed)
{
gint result = procmsg_send_message_queue_full(file, FALSE, errstr, queue, msgnum);
gint result = procmsg_send_message_queue_full(file, FALSE, errstr, queue, msgnum, queued_removed);
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
return result;
}

View file

@ -329,7 +329,8 @@ gint procmsg_cmp_msgnum_for_sort (gconstpointer a,
gint procmsg_send_message_queue (const gchar *file,
gchar **errstr,
FolderItem *queue,
gint msgnum);
gint msgnum,
gboolean *queued_removed);
void procmsg_msginfo_set_flags (MsgInfo *msginfo,
MsgPermFlags perm_flags,