add test to allow moving only within the same mailbox
[claws.git] / src / folder.c
index f96777f428c971d32f4cf1b3ebe9d6d0a685a9d6..28770c6f65c3514385bf015fb6e36e011f0d7a99 100644 (file)
@@ -1615,6 +1615,10 @@ gint folder_item_move_to(FolderItem *src, FolderItem *dest, FolderItem **new_ite
                return F_MOVE_FAILED;
        }
 
+       if (src->folder != dest->folder) {
+               return F_MOVE_FAILED_DEST_OUTSIDE_MAILBOX;
+       }
+
        phys_srcpath = folder_item_get_path(src);
        phys_dstpath = g_strconcat(folder_item_get_path(dest),G_DIR_SEPARATOR_S,g_basename(phys_srcpath),NULL);