create directories for incoming transfers

This commit is contained in:
Green Sky 2023-08-03 13:32:17 +02:00
parent 3c25162ba1
commit e28c2502d6
No known key found for this signature in database

View File

@ -1,5 +1,6 @@
#include "./tox_transfer_manager.hpp"
#include <filesystem>
#include <solanaceae/toxcore/tox_interface.hpp>
#include <solanaceae/message3/file_r_file.hpp>
@ -245,6 +246,8 @@ bool ToxTransferManager::setFilePathDir(Message3Handle transfer, std::string_vie
full_file_path += "/";
}
std::filesystem::create_directories(full_file_path);
// TODO: read file name(s) from comp
if (transfer.all_of<Message::Components::Transfer::FileInfo>()) {
const auto& file_info = transfer.get<Message::Components::Transfer::FileInfo>();