When copying a folder, copy its metadata before copying contents.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 1 Nov 2014 10:27:41 +0000 (11:27 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 1 Nov 2014 10:27:41 +0000 (11:27 +0100)
src/folder.c

index 2a8d862..4bd2447 100644 (file)
@@ -3255,16 +3255,6 @@ static FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest,
        log_message(LOG_PROTOCOL, copy ?_("Copying %s to %s...\n"):_("Moving %s to %s...\n"), 
                        src->name, new_item->path);
 
-       mlist = folder_item_get_msg_list(src);
-       
-       if (mlist != NULL) {
-               if (copy)
-                       folder_item_copy_msgs(new_item, mlist);
-               else
-                       folder_item_move_msgs(new_item, mlist);
-               procmsg_msg_list_free(mlist);
-       }
-       
        /*copy prefs*/
        folder_item_prefs_copy_prefs(src, new_item);
        
@@ -3283,6 +3273,16 @@ static FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest,
        new_item->sort_key  = src->sort_key;
        new_item->sort_type = src->sort_type;
 
+       mlist = folder_item_get_msg_list(src);
+
+       if (mlist != NULL) {
+               if (copy)
+                       folder_item_copy_msgs(new_item, mlist);
+               else
+                       folder_item_move_msgs(new_item, mlist);
+               procmsg_msg_list_free(mlist);
+       }
+
        prefs_matcher_write_config();
        
        /* recurse */