fix bugzilla bug #20
authorColin Leroy <colin@colino.net>
Wed, 15 Jan 2003 23:56:31 +0000 (23:56 +0000)
committerColin Leroy <colin@colino.net>
Wed, 15 Jan 2003 23:56:31 +0000 (23:56 +0000)
ChangeLog.claws
configure.ac
src/compose.c
src/compose.h

index 638af5f891b70d6ee1e9cb66857eb85362ab21b2..5ded8ebafed173ed88207b4dc20ec07642045dab 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-16 [colin]     0.8.8claws104
+
+       * src/compose.[ch]
+               Fix bug with autosaved drafts for IMAP, when draft
+               folder is specified - fixes bugzilla bug #20
+
 2003-01-15 [paul]      0.8.8claws103
 
        * src/compose.[ch]
index 0d4d15cee728da345195f90dd2e6baf2f09a7950..fa2c25495020a1fa1ea4840052d69132761fc17c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws103
+EXTRA_VERSION=claws104
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 442bccae8200135f7813514fbbaf16e133a499c6..bbc2b8df8deef1ffad80a0b249481044635191b1 100644 (file)
@@ -3467,7 +3467,8 @@ static gint compose_remove_reedit_target(Compose *compose)
        g_return_val_if_fail(item != NULL, -1);
 
        if (procmsg_msg_exist(msginfo) &&
-           (item->stype == F_DRAFT || item->stype == F_QUEUE)) {
+           (item->stype == F_DRAFT || item->stype == F_QUEUE 
+            || msginfo == compose->autosaved_draft)) {
                if (folder_item_remove_msg(item, msginfo->msgnum) < 0) {
                        g_warning("can't remove the old message\n");
                        return -1;
@@ -6094,7 +6095,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
        
        lock = FALSE;
 
-       /* 0: quit editing  1: keep editing */
+       /* 0: quit editing  1: keep editing  2: keep editing (autosave) */
        if (action == 0)
                gtk_widget_destroy(compose->window);
        else {
@@ -6118,6 +6119,10 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
                compose->targetinfo->mtime = s.st_mtime;
                compose->targetinfo->folder = draft;
                compose->mode = COMPOSE_REEDIT;
+               
+               if (action == 2) {
+                       compose->autosaved_draft = compose->targetinfo;
+               }
        }
 }
 
@@ -6778,7 +6783,7 @@ static void text_inserted(GtkWidget *widget, const gchar *text,
        
        if (prefs_common.autosave && 
            gtk_stext_get_length(GTK_STEXT(widget)) % prefs_common.autosave_length == 0)
-               compose_draft_cb((gpointer)compose, 1, NULL);
+               compose_draft_cb((gpointer)compose, 2, NULL);
 }
 
 static gboolean compose_send_control_enter(Compose *compose)
index a0da8898223506d3b7a3b6b9e3f27cecdacab05b..be658283ecf375d9f59598ec1e09f5b85bd692d3 100644 (file)
@@ -140,6 +140,7 @@ struct _Compose
 
        MsgInfo *targetinfo;
        MsgInfo *replyinfo;
+       MsgInfo *autosaved_draft;
        MsgInfo *fwdinfo;
 
        GtkWidget *header_table;