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 638af5f..5ded8eb 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 0d4d15c..fa2c254 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 442bcca..bbc2b8d 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 a0da889..be65828 100644 (file)
@@ -140,6 +140,7 @@ struct _Compose
 
        MsgInfo *targetinfo;
        MsgInfo *replyinfo;
+       MsgInfo *autosaved_draft;
        MsgInfo *fwdinfo;
 
        GtkWidget *header_table;