2006-01-02 [colin] 1.9.100cvs119
authorColin Leroy <colin@colino.net>
Mon, 2 Jan 2006 17:59:13 +0000 (17:59 +0000)
committerColin Leroy <colin@colino.net>
Mon, 2 Jan 2006 17:59:13 +0000 (17:59 +0000)
* src/compose.c
* src/imap.c
Fix autosave on IMAP and more generally try to
return the correct ID on a newly added IMAP message

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/imap.c

index 99af3fb4bde9cf3aefe43c2b1ea87168ff1909c4..1b6f4a7510a9000b4f82f1b7104f7a9500b7aaf6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-02 [colin]     1.9.100cvs119
+
+       * src/compose.c
+       * src/imap.c
+               Fix autosave on IMAP and more generally try to
+               return the correct ID on a newly added IMAP message
+
 2006-01-02 [paul]      1.9.100cvs118
 
        * manual/keyboard.xml
index 5f8aa8e7d550fd763daa49a91c07ec7caeda9ee4..fdd4d8a41020ae20939181a57288c81943809060 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 manual/advanced.xml;  ) > 1.9.100cvs116.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/gtk/authors.h;  ) > 1.9.100cvs117.patchset
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/keyboard.xml;  ) > 1.9.100cvs118.patchset
+( cvs diff -u -r 1.382.2.212 -r 1.382.2.213 src/compose.c;  cvs diff -u -r 1.179.2.87 -r 1.179.2.88 src/imap.c;  ) > 1.9.100cvs119.patchset
index 8b2b817dc3278683ccb5151d422d369ecc634409..559ce78a43eff51e1d26ed477da577521ce13762 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=118
+EXTRA_VERSION=119
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e526015441b9bbb70d65f28d1ed76d5ac0ae5746..cb30d686635cbe99b2804e2735675824bfee4111 100644 (file)
@@ -7120,7 +7120,10 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
                gchar *path;
 
                path = folder_item_fetch_msg(draft, msgnum);
-               g_return_if_fail(path != NULL);
+               if (path == NULL) {
+                       debug_print("can't fetch %s:%d\n",draft->path, msgnum);
+                       goto unlock;
+               }
                if (g_stat(path, &s) < 0) {
                        FILE_OP_ERROR(path, "stat");
                        g_free(path);
index 1c61729f6faa14a919c98e9bff5f588d10ca158e..ac9d74063c68bb8196846bd30e6b71fef8e37164 100644 (file)
@@ -1099,6 +1099,9 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
                        g_relation_insert(relation, fileinfo->msginfo != NULL ? 
                                          (gpointer) fileinfo->msginfo : (gpointer) fileinfo,
                                          GINT_TO_POINTER(dest->last_num + 1));
+               if (new_uid == 0) {
+                       new_uid = dest->last_num+1;
+               }
                if (last_uid < new_uid)
                        last_uid = new_uid;
                if (file_is_tmp)
@@ -3094,6 +3097,8 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list,
                        ok = imap_status(session, IMAP_FOLDER(folder), item->item.path, item,
                                 &exists, &uid_next, &uid_val, NULL, FALSE);
                }
+               item->item.last_num = uid_next - 1;
+               
                item->use_cache = (time_t)0;
                if (ok != IMAP_SUCCESS) {
                        statusbar_pop_all();
@@ -3352,6 +3357,7 @@ gboolean imap_scan_required(Folder *folder, FolderItem *_item)
                item->c_uid_next = uid_next;
                item->c_uid_validity = uid_val;
                item->c_unseen = unseen;
+               item->item.last_num = uid_next - 1;
                debug_print("uidnext %d, item->uid_next %d, exists %d, item->item.total_msgs %d\n", 
                        uid_next, item->uid_next, exists, item->item.total_msgs);
                if ((uid_next != item->uid_next) || (exists != item->item.total_msgs)) {