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

messagesadapter: re-add isSwarm

This show "Copy to Downloads" for file transfer in swarm.

Change-Id: I7002ce22898ced361ca3df1fa535dd7ec88e0d70
GitLab: https://git.jami.net/savoirfairelinux/ring-project/-/issues/1282
parent 748e161b
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,7 @@ MessagesAdapter::setupChatView(const QVariantMap& convInfo) ...@@ -62,6 +62,7 @@ MessagesAdapter::setupChatView(const QVariantMap& convInfo)
Utils::oneShotConnect(qmlObj_, SIGNAL(messagesCleared()), this, SLOT(slotMessagesCleared())); Utils::oneShotConnect(qmlObj_, SIGNAL(messagesCleared()), this, SLOT(slotMessagesCleared()));
setMessagesVisibility(false); setMessagesVisibility(false);
clearChatView(); clearChatView();
setIsSwarm(convInfo["isSwarm"].toBool());
Q_EMIT newMessageBarPlaceholderText(convInfo["title"].toString()); Q_EMIT newMessageBarPlaceholderText(convInfo["title"].toString());
} }
...@@ -374,6 +375,13 @@ MessagesAdapter::setMessagesVisibility(bool visible) ...@@ -374,6 +375,13 @@ MessagesAdapter::setMessagesVisibility(bool visible)
QMetaObject::invokeMethod(qmlObj_, "webViewRunJavaScript", Q_ARG(QVariant, s)); QMetaObject::invokeMethod(qmlObj_, "webViewRunJavaScript", Q_ARG(QVariant, s));
} }
void
MessagesAdapter::setIsSwarm(bool isSwarm)
{
QString s = QString::fromLatin1("set_is_swarm(%1)").arg(isSwarm);
QMetaObject::invokeMethod(qmlObj_, "webViewRunJavaScript", Q_ARG(QVariant, s));
}
void void
MessagesAdapter::clearChatView() MessagesAdapter::clearChatView()
{ {
......
...@@ -69,6 +69,7 @@ protected: ...@@ -69,6 +69,7 @@ protected:
// Run corrsponding js functions, c++ to qml. // Run corrsponding js functions, c++ to qml.
void setMessagesVisibility(bool visible); void setMessagesVisibility(bool visible);
void setIsSwarm(bool isSwarm);
void clearChatView(); void clearChatView();
void updateHistory(ConversationModel& conversationModel, void updateHistory(ConversationModel& conversationModel,
MessagesList interactions, MessagesList interactions,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment