Commit a48299e3 authored by Sébastien Blin's avatar Sébastien Blin Committed by Guillaume Roguez

conversationmodel: fix transfer interaction's author in the database

Change-Id: I6fbbd7d50d44f68d8f249e474a93a233ad606df7
Reviewed-by: Guillaume Roguez's avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 5a93f582
......@@ -219,7 +219,6 @@ addDataTransferToConversation(Database& db,
const api::datatransfer::Info& infoFromDaemon)
{
auto peerProfileId = getProfileId(db, infoFromDaemon.peerUri);
auto authorId = peerProfileId;
return db.insertInto("interactions", {
{":account_id", "account_id"},
......@@ -231,7 +230,7 @@ addDataTransferToConversation(Database& db,
{":status", "status"}
}, {
{":account_id", accountProfileId},
{":author_id", authorId},
{":author_id", infoFromDaemon.isOutgoing? accountProfileId : peerProfileId},
{":conversation_id", conversationId},
{":timestamp", std::to_string(std::time(nullptr))},
{":body", infoFromDaemon.displayName},
......
......@@ -1403,7 +1403,7 @@ ConversationModelPimpl::slotTransferStatusCreated(long long dringId, datatransfe
auto interactioType = info.isOutgoing ?
interaction::Type::OUTGOING_DATA_TRANSFER :
interaction::Type::INCOMING_DATA_TRANSFER;
auto interaction = interaction::Info {contactProfileId,
auto interaction = interaction::Info {info.isOutgoing? accountProfileId : contactProfileId,
info.displayName,
std::time(nullptr),
interactioType,
......
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