Skip to content
Snippets Groups Projects
Commit 5e2f8528 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

conversation: fix sendFile for swarm

Change-Id: I72e58f8aef09c07752169fbbc6194a2ef33b36d5
parent e633efb1
No related branches found
No related tags found
No related merge requests found
......@@ -3428,6 +3428,10 @@ ConversationModel::sendFile(const QString& convUid, const QString& path, const Q
{
try {
auto& conversation = pimpl_->getConversationForUid(convUid, true).get();
if (conversation.isSwarm()) {
owner.dataTransferModel->sendFile(owner.id, "", convUid, path, filename);
return;
}
auto peers = pimpl_->peersForConversation(conversation);
if (peers.size() < 1) {
qDebug() << "send file error: could not send file in conversation with no participants";
......@@ -3438,9 +3442,6 @@ ConversationModel::sendFile(const QString& convUid, const QString& path, const Q
Conversations for new contact from search result are NON_SWARM but after receiving
conversationReady callback could be updated to ONE_TO_ONE. We still use conversationReady
callback for one_to_one conversation to check if contact is blocked*/
if (peers.size() > 1) {
owner.dataTransferModel->sendFile(owner.id, "", convUid, path, filename);
}
const auto peerId = peers.front();
bool isTemporary = peerId == convUid;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment