Skip to content
Snippets Groups Projects
Unverified Commit 00c8256e authored by Sébastien Blin's avatar Sébastien Blin
Browse files

conversationmodel: sync little files on conversation loaded

After a sync, when loading a conversations, little files should sync

Change-Id: Ib24b3b11a519f4715a904db27e04aed455f61b5f
GitLab: jami-client-qt#455
parent 30fa897d
Branches
No related tags found
No related merge requests found
...@@ -2158,6 +2158,7 @@ ConversationModelPimpl::slotConversationLoaded(uint32_t, ...@@ -2158,6 +2158,7 @@ ConversationModelPimpl::slotConversationLoaded(uint32_t,
} }
auto msgId = message["id"]; auto msgId = message["id"];
auto msg = interaction::Info(message, linked.owner.profileInfo.uri); auto msg = interaction::Info(message, linked.owner.profileInfo.uri);
auto downloadFile = false;
if (msg.type == interaction::Type::DATA_TRANSFER) { if (msg.type == interaction::Type::DATA_TRANSFER) {
auto fileId = message["fileId"]; auto fileId = message["fileId"];
QString path; QString path;
...@@ -2178,10 +2179,18 @@ ConversationModelPimpl::slotConversationLoaded(uint32_t, ...@@ -2178,10 +2179,18 @@ ConversationModelPimpl::slotConversationLoaded(uint32_t,
: bytesProgress == totalSize ? interaction::Status::TRANSFER_FINISHED : bytesProgress == totalSize ? interaction::Status::TRANSFER_FINISHED
: interaction::Status::TRANSFER_ONGOING; : interaction::Status::TRANSFER_ONGOING;
linked.owner.dataTransferModel->registerTransferId(fileId, msgId); linked.owner.dataTransferModel->registerTransferId(fileId, msgId);
downloadFile = (bytesProgress == 0);
} else if (msg.type == interaction::Type::CALL) { } else if (msg.type == interaction::Type::CALL) {
msg.body = storage::getCallInteractionString(msg.authorUri, msg.duration); msg.body = storage::getCallInteractionString(msg.authorUri, msg.duration);
} }
insertSwarmInteraction(msgId, msg, conversation, true); insertSwarmInteraction(msgId, msg, conversation, true);
if (downloadFile) {
// Note, we must do this after insertSwarmInteraction to find the interaction
handleIncomingFile(conversationId,
msgId,
message["displayName"],
message["totalSize"].toInt());
}
} }
for (int j = conversation.interactions.size() - 1; j >= 0; j--) { for (int j = conversation.interactions.size() - 1; j >= 0; j--) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment