data_transfer: receive incoming profiles in dedicated directory

this avoid to create a dirty cache

Change-Id: Icde80be0fe241774a1e21eea4558ba76f2559f9f
This commit is contained in:
Sébastien Blin
2022-06-07 15:33:26 -04:00
parent 35d201ee26
commit e7243cecfe

View File

@ -609,7 +609,11 @@ IncomingFileTransfer::requestFilename(const std::function<void(const std::string
emit(DRing::DataTransferEventCode::wait_host_acceptance);
if (internalCompletionCb_) {
std::string filename = fileutils::get_cache_dir() + DIR_SEPARATOR_STR + std::to_string(id);
std::string path = fmt::format("{}/{}/profiles",
fileutils::get_cache_dir(),
info_.accountId);
fileutils::recursive_mkdir(path);
auto filename = fmt::format("{}/{}", path, id);
fileutils::ofstream(filename);
if (not fileutils::isFile(filename))
throw std::system_error(errno, std::generic_category());