Skip to content
Snippets Groups Projects
Commit 4e3cf29e authored by Sébastien Blin's avatar Sébastien Blin Committed by Andreas Traczyk
Browse files

chatview: react to save button

Change-Id: I33717f148b837475a4f4874f327ed86de6f441cf
parent a7e7105c
Branches
Tags
No related merge requests found
......@@ -227,6 +227,10 @@ Rectangle {
messageWebViewRect.messagesLoaded()
}
function copyToDownloads(interactionId, displayName) {
MessagesAdapter.copyToDownloads(interactionId, displayName)
}
function emitPasteKeyDetected() {
MessagesAdapter.pasteKeyDetected()
}
......
......@@ -28,6 +28,8 @@
#include "utils.h"
#include "webchathelpers.h"
#include <api/datatransfermodel.h>
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
......@@ -368,6 +370,18 @@ MessagesAdapter::retryInteraction(const QString& interactionId)
->retryInteraction(lrcInstance_->get_selectedConvUid(), interactionId);
}
void
MessagesAdapter::copyToDownloads(const QString& interactionId, const QString& displayName)
{
auto downloadDir = lrcInstance_->accountModel().downloadDirectory;
if (auto accInfo = &lrcInstance_->getCurrentAccountInfo())
accInfo->dataTransferModel->copyTo(lrcInstance_->getCurrentAccountId(),
lrcInstance_->get_selectedConvUid(),
interactionId,
downloadDir,
displayName);
}
void
MessagesAdapter::setNewMessagesContent(const QString& path)
{
......
......@@ -67,6 +67,7 @@ protected:
Q_INVOKABLE void pasteKeyDetected();
Q_INVOKABLE void onComposing(bool isComposing);
Q_INVOKABLE void loadMessages(int n);
Q_INVOKABLE void copyToDownloads(const QString& interactionId, const QString& displayName);
// Manually update draft when hiding message web view (Back to welcome page).
Q_INVOKABLE void updateDraft();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment