2006-08-27 [colin] 2.4.0cvs98
authorColin Leroy <colin@colino.net>
Sun, 27 Aug 2006 10:31:59 +0000 (10:31 +0000)
committerColin Leroy <colin@colino.net>
Sun, 27 Aug 2006 10:31:59 +0000 (10:31 +0000)
* src/compose.c
* src/messageview.c
* src/procmsg.c
* src/procmsg.h
When possible, copy the queued mail to sent folder
instead of re-adding. Much faster on IMAP.

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/messageview.c
src/procmsg.c
src/procmsg.h

index ca2b360..c0a7bee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-08-27 [colin]     2.4.0cvs98
+
+       * src/compose.c
+       * src/messageview.c
+       * src/procmsg.c
+       * src/procmsg.h
+               When possible, copy the queued mail to sent folder
+               instead of re-adding. Much faster on IMAP.
+
 2006-08-27 [colin]     2.4.0cvs97
 
        * src/msgcache.c
index c9a3aba..298ce8e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 manual/handling.xml;  ) > 2.4.0cvs95.patchset
 ( cvs diff -u -r 1.654.2.1834 -r 1.654.2.1835 configure.ac;  cvs diff -u -r 1.8.2.5 -r 1.8.2.6 src/plugins/Makefile.am;  diff -u /dev/null src/plugins/bogofilter/.cvsignore;  diff -u /dev/null src/plugins/bogofilter/Makefile.am;  diff -u /dev/null src/plugins/bogofilter/bogofilter.c;  diff -u /dev/null src/plugins/bogofilter/bogofilter.h;  diff -u /dev/null src/plugins/bogofilter/bogofilter_gtk.c;  ) > 2.4.0cvs96.patchset
 ( cvs diff -u -r 1.16.2.37 -r 1.16.2.38 src/msgcache.c;  cvs diff -u -r 1.395.2.235 -r 1.395.2.236 src/summaryview.c;  cvs diff -u -r 1.13.2.19 -r 1.13.2.20 src/common/plugin.c;  cvs diff -u -r 1.5.2.6 -r 1.5.2.7 src/common/plugin.h;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/common/timing.h;  cvs diff -u -r 1.13.2.22 -r 1.13.2.23 src/plugins/clamav/clamav_plugin.c;  cvs diff -u -r 1.13.2.7 -r 1.13.2.8 src/plugins/demo/demo.c;  cvs diff -u -r 1.12.2.13 -r 1.12.2.14 src/plugins/dillo_viewer/dillo_viewer.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/plugins/pgpcore/plugin.c;  cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/plugins/pgpinline/pgpinline.c;  cvs diff -u -r 1.1.2.37 -r 1.1.2.38 src/plugins/pgpmime/pgpmime.c;  cvs diff -u -r 1.18.2.36 -r 1.18.2.37 src/plugins/spamassassin/spamassassin.c;  cvs diff -u -r 1.14.2.36 -r 1.14.2.37 src/plugins/trayicon/trayicon.c;  ) > 2.4.0cvs97.patchset
+( cvs diff -u -r 1.382.2.304 -r 1.382.2.305 src/compose.c;  cvs diff -u -r 1.94.2.99 -r 1.94.2.100 src/messageview.c;  cvs diff -u -r 1.150.2.75 -r 1.150.2.76 src/procmsg.c;  cvs diff -u -r 1.60.2.33 -r 1.60.2.34 src/procmsg.h;  ) > 2.4.0cvs98.patchset
index acb860c..25fb26f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=97
+EXTRA_VERSION=98
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 59d7ce2..a9cb719 100644 (file)
@@ -4144,13 +4144,12 @@ gint compose_send(Compose *compose)
                inc_unlock();
                return -1;
        }
-       
        if (msgpath == NULL) {
                msgpath = folder_item_fetch_msg(folder, msgnum);
-               val = procmsg_send_message_queue(msgpath, &errstr);
+               val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum);
                g_free(msgpath);
        } else {
-               val = procmsg_send_message_queue(msgpath, &errstr);
+               val = procmsg_send_message_queue(msgpath, &errstr, folder, msgnum);
                g_unlink(msgpath);
                g_free(msgpath);
        }
index 80aa8eb..7ad2720 100644 (file)
@@ -713,7 +713,7 @@ static gint disposition_notification_send(MsgInfo *msginfo)
 
        /* send it */
        path = folder_item_fetch_msg(queue, num);
-       ok = procmsg_send_message_queue(path, &foo);
+       ok = procmsg_send_message_queue(path, &foo, queue, num);
        g_free(path);
        g_free(foo);
        folder_item_remove_msg(queue, num);
index ce066f0..4879c1b 100644 (file)
@@ -48,7 +48,8 @@
 #include "timing.h"
 #include "inc.h"
 
-static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr);
+static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr,
+                                           FolderItem *queue, gint msgnum);
 
 enum
 {
@@ -940,7 +941,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, gchar **errstr)
                        if (file) {
                                if (procmsg_send_message_queue_full(file, 
                                                !procmsg_is_last_for_account(queue, msginfo, elem),
-                                               errstr) < 0) {
+                                               errstr, queue, msginfo->msgnum) < 0) {
                                        g_warning("Sending queued message %d failed.\n", 
                                                  msginfo->msgnum);
                                        err++;
@@ -1450,7 +1451,8 @@ gint procmsg_cmp_msgnum_for_sort(gconstpointer a, gconstpointer b)
        return msginfo1->msgnum - msginfo2->msgnum;
 }
 
-static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr)
+static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_session, gchar **errstr,
+                                           FolderItem *queue, gint msgnum)
 {
        static HeaderEntry qentry[] = {{"S:",    NULL, FALSE},
                                       {"SSV:",  NULL, FALSE},
@@ -1730,7 +1732,15 @@ send_mail:
                        outbox = folder_get_default_outbox();
                        
                if (save_clear_text || tmp_enc_file == NULL) {
-                       procmsg_save_to_outbox(outbox, file, TRUE);
+                       gboolean saved = FALSE;
+                       if (queue && msgnum > 0) {
+                               MsgInfo *queued_mail = folder_item_get_msginfo(queue, msgnum);
+                               if (folder_item_copy_msg(outbox, queued_mail) >= 0)
+                                       saved = TRUE;
+                               procmsg_msginfo_free(queued_mail);
+                       }
+                       if (!saved)
+                               procmsg_save_to_outbox(outbox, file, TRUE);
                } else {
                        procmsg_save_to_outbox(outbox, tmp_enc_file, FALSE);
                }
@@ -1799,9 +1809,9 @@ send_mail:
        return (newsval != 0 ? newsval : mailval);
 }
 
-gint procmsg_send_message_queue(const gchar *file, gchar **errstr)
+gint procmsg_send_message_queue(const gchar *file, gchar **errstr, FolderItem *queue, gint msgnum)
 {
-       gint result = procmsg_send_message_queue_full(file, FALSE, errstr);
+       gint result = procmsg_send_message_queue_full(file, FALSE, errstr, queue, msgnum);
        toolbar_main_set_sensitive(mainwindow_get_mainwindow());
        return result;
 }
index f5fcf8e..ed36412 100644 (file)
@@ -323,7 +323,9 @@ guint        procmsg_msginfo_memusage       (MsgInfo        *msginfo);
 gint procmsg_cmp_msgnum_for_sort       (gconstpointer   a,
                                         gconstpointer   b);
 gint procmsg_send_message_queue                (const gchar *file,
-                                        gchar **errstr);
+                                        gchar **errstr,
+                                        FolderItem *queue, 
+                                        gint msgnum);
 
 void procmsg_msginfo_set_flags         (MsgInfo *msginfo,
                                         MsgPermFlags perm_flags,