Commit 7b04cb70 authored by Sébastien Blin's avatar Sébastien Blin

filetransfer: create directory if it doesn't exists

Change-Id: I6179f70d76b18fbd90370538dcd82450adcbf754
parent c3273b2f
...@@ -2285,6 +2285,9 @@ ConversationModelPimpl::acceptTransfer(const QString& convUid, uint64_t interact ...@@ -2285,6 +2285,9 @@ ConversationModelPimpl::acceptTransfer(const QString& convUid, uint64_t interact
destinationDir += "/"; destinationDir += "/";
} }
#endif #endif
QDir dir = QFileInfo(destinationDir + path).absoluteDir();
if (!dir.exists())
dir.mkpath(".");
auto acceptedFilePath = lrc.getDataTransferModel().accept(interactionId, destinationDir + path, 0); auto acceptedFilePath = lrc.getDataTransferModel().accept(interactionId, destinationDir + path, 0);
storage::updateInteractionBody(db, interactionId, acceptedFilePath); storage::updateInteractionBody(db, interactionId, acceptedFilePath);
storage::updateInteractionStatus(db, interactionId, interaction::Status::TRANSFER_ACCEPTED); storage::updateInteractionStatus(db, interactionId, interaction::Status::TRANSFER_ACCEPTED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment