When copying a folder, copy its metadata before copying contents.
[claws.git] / src / folder.c
index 2a8d862cab7404c5d9e0e03ba8fa9f5ad5fb3c7c..4bd24479b8168c2def48f8722a75e466047a6eaa 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 */