Commit 4968dcf8 authored by Andreas Traczyk's avatar Andreas Traczyk

call: add conference feature

Change-Id: I84382a10725b53913c28d2fd66d7ddead12da1a0
parent 3b71cdad
......@@ -183,7 +183,7 @@ CallWidget::CallWidget(QWidget* parent) :
connect(ui->messageView, &MessageWebView::invitationAccepted,
[this] {
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->makePermanent(convUid);
ui->sendContactRequestButton->hide();
});
......@@ -318,7 +318,7 @@ CallWidget::onIncomingMessage(const std::string& accountId, const std::string& c
QString::fromStdString(interaction.body));
}
updateConversationsFilterWidget();
if (convUid != LRCInstance::getSelectedConvUid()) {
if (convUid != LRCInstance::getCurrentConvUid()) {
return;
}
convModel->clearUnreadInteractions(convUid);
......@@ -360,7 +360,7 @@ CallWidget::setupSmartListContextMenu(const QPoint& pos)
[this, convUid, conversation, convModel]() {
convModel->placeCall(convUid);
ui->callingPhoto->setPixmap(QPixmap::fromImage(imageForConv(convUid)));
if (convUid != LRCInstance::getSelectedConvUid()) {
if (convUid != LRCInstance::getCurrentConvUid()) {
selectConversation(conversation, *convModel);
}
});
......@@ -371,7 +371,7 @@ CallWidget::setupSmartListContextMenu(const QPoint& pos)
[this, convUid, conversation, convModel]() {
convModel->placeAudioOnlyCall(convUid);
ui->callingPhoto->setPixmap(QPixmap::fromImage(imageForConv(convUid)));
if (convUid != LRCInstance::getSelectedConvUid()) {
if (convUid != LRCInstance::getCurrentConvUid()) {
selectConversation(conversation, *convModel);
}
});
......@@ -497,7 +497,7 @@ CallWidget::on_cancelButton_clicked()
void
CallWidget::showConversationView()
{
if (LRCInstance::getSelectedConvUid().empty()) {
if (LRCInstance::getCurrentConvUid().empty()) {
backToWelcomePage();
return;
}
......@@ -543,9 +543,9 @@ CallWidget::on_smartList_doubleClicked(const QModelIndex& index)
selectConversation(index);
LRCInstance::getCurrentConversationModel()->placeCall(LRCInstance::getSelectedConvUid());
LRCInstance::getCurrentConversationModel()->placeCall(LRCInstance::getCurrentConvUid());
ui->callingPhoto->setPixmap(QPixmap::fromImage(imageForConv(LRCInstance::getSelectedConvUid())));
ui->callingPhoto->setPixmap(QPixmap::fromImage(imageForConv(LRCInstance::getCurrentConvUid())));
}
QImage
......@@ -642,7 +642,7 @@ void
CallWidget::slotBlockInviteClicked(const QModelIndex & index)
{
auto convUid = index.data(static_cast<int>(SmartListModel::Role::UID)).value<QString>().toStdString();
if (!convUid.empty() && convUid == LRCInstance::getSelectedConvUid()) {
if (!convUid.empty() && convUid == LRCInstance::getCurrentConvUid()) {
backToWelcomePage();
}
LRCInstance::getCurrentConversationModel()->removeConversation(convUid, true);
......@@ -652,7 +652,7 @@ void
CallWidget::slotIgnoreInviteClicked(const QModelIndex & index)
{
auto convUid = index.data(static_cast<int>(SmartListModel::Role::UID)).value<QString>().toStdString();
if (!convUid.empty() && convUid == LRCInstance::getSelectedConvUid()) {
if (!convUid.empty() && convUid == LRCInstance::getCurrentConvUid()) {
backToWelcomePage();
}
LRCInstance::getCurrentConversationModel()->removeConversation(convUid, false);
......@@ -688,7 +688,7 @@ CallWidget::slotShowCallView(const std::string& accountId,
ui->callStackWidget->setCurrentWidget(ui->videoPage);
hideMiniSpinner();
ui->videoView->setupForConversation(accountId, convInfo.uid);
ui->videoView->updateCall(convInfo.uid, accountId);
ui->videoView->show();
ui->videoView->setFocus();
}
......@@ -713,7 +713,7 @@ CallWidget::slotShowIncomingCallView(const std::string& accountId,
auto finalBestId = (bestName != bestId) ? bestId : "";
auto call = callModel->getCall(convInfo.callId);
auto isCallSelected = LRCInstance::getSelectedConvUid() == convInfo.uid;
auto isCallSelected = LRCInstance::getCurrentConvUid() == convInfo.uid;
ui->callingStatusLabel->setText(QString::fromStdString(lrc::api::call::to_string(call.status)));
connect(callModel, &lrc::api::NewCallModel::callStatusChanged, ui->incomingCallPage,
......@@ -1132,7 +1132,7 @@ CallWidget::connectConversationModel()
ui->messageView->clear();
// if currently selected,
// switch to welcome screen (deselecting current smartlist item )
if (convUid != LRCInstance::getSelectedConvUid()) {
if (convUid != LRCInstance::getCurrentConvUid()) {
return;
}
backToWelcomePage();
......@@ -1141,7 +1141,7 @@ CallWidget::connectConversationModel()
interactionStatusUpdatedConnection_ = QObject::connect(
currentConversationModel, &lrc::api::ConversationModel::interactionStatusUpdated,
[this](const std::string& convUid, uint64_t interactionId, const lrc::api::interaction::Info& interaction) {
if (convUid != LRCInstance::getSelectedConvUid()) {
if (convUid != LRCInstance::getCurrentConvUid()) {
return;
}
auto& currentAccountInfo = LRCInstance::getCurrentAccountInfo();
......@@ -1175,7 +1175,7 @@ CallWidget::connectConversationModel()
void
CallWidget::updateConversationView(const std::string& convUid)
{
if (convUid != LRCInstance::getSelectedConvUid()) {
if (convUid != LRCInstance::getCurrentConvUid()) {
return;
}
}
......@@ -1193,7 +1193,7 @@ CallWidget::selectConversation(const QModelIndex& index)
if (selectConversation(item, *convModel)) {
showChatView(index);
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
if (!lastConvUid_.compare(convUid)) {
return;
}
......@@ -1215,7 +1215,7 @@ bool
CallWidget::selectConversation( const lrc::api::conversation::Info& item,
lrc::api::ConversationModel& convModel)
{
if (LRCInstance::getSelectedConvUid() == item.uid) {
if (LRCInstance::getCurrentConvUid() == item.uid) {
return false;
} else if (item.participants.size() > 0) {
LRCInstance::setSelectedConvId(item.uid);
......@@ -1229,7 +1229,7 @@ CallWidget::selectConversation( const lrc::api::conversation::Info& item,
void
CallWidget::deselectConversation()
{
if (LRCInstance::getSelectedConvUid().empty()) {
if (LRCInstance::getCurrentConvUid().empty()) {
return;
}
......@@ -1257,7 +1257,7 @@ CallWidget::updateConversationForNewContact(const std::string& convUid)
return;
}
ui->ringContactLineEdit->setText("");
auto selectedUid = LRCInstance::getSelectedConvUid();
auto selectedUid = LRCInstance::getCurrentConvUid();
auto& conversation = LRCInstance::getConversationFromConvUid(convUid, {}, true);
if (!conversation.uid.empty()) {
try {
......@@ -1313,15 +1313,16 @@ CallWidget::update()
}
void
CallWidget::connectAccount(const std::string& accId)
CallWidget::connectAccount(const std::string& accountId)
{
try {
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accId);
auto callModel = accInfo.callModel.get();
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId);
QObject::disconnect(callStatusChangedConnection_);
callStatusChangedConnection_ = QObject::connect(callModel,
callStatusChangedConnection_ = QObject::connect(
accInfo.callModel.get(),
&lrc::api::NewCallModel::callStatusChanged,
[this, &accInfo, accId](const std::string& callId) {
[this, accountId](const std::string& callId) {
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId);
auto& callModel = accInfo.callModel;
auto call = callModel->getCall(callId);
switch (call.status) {
......@@ -1331,35 +1332,43 @@ CallWidget::connectAccount(const std::string& accId)
case lrc::api::call::Status::PEER_BUSY:
case lrc::api::call::Status::TIMEOUT:
case lrc::api::call::Status::TERMINATING: {
LRCInstance::renderer()->removeDistantRenderer(callId);
ui->videoView->updateCall();
setCallPanelVisibility(false);
showConversationView();
break;
}
case lrc::api::call::Status::CONNECTED:
case lrc::api::call::Status::IN_PROGRESS: {
auto convInfo = LRCInstance::getConversationFromCallId(callId, accId);
if (!convInfo.uid.empty() && convInfo.uid == LRCInstance::getSelectedConvUid()) {
auto convInfo = LRCInstance::getConversationFromCallId(callId, accountId);
if (!convInfo.uid.empty() && convInfo.uid == LRCInstance::getCurrentConvUid()) {
accInfo.conversationModel->selectConversation(convInfo.uid);
}
LRCInstance::renderer()->addDistantRenderer(convInfo.callId);
LRCInstance::renderer()->addDistantRenderer(callId);
ui->videoView->updateCall();
break;
}
case lrc::api::call::Status::PAUSED:
ui->videoView->resetPreview();
ui->videoView->updateCall();
default:
break;
}
ui->smartList->update();
});
auto& contactModel = accInfo.contactModel;
disconnect(contactAddedConnection_);
contactAddedConnection_ = connect(contactModel.get(),
QObject::disconnect(contactAddedConnection_);
contactAddedConnection_ = QObject::connect(
accInfo.contactModel.get(),
&lrc::api::ContactModel::contactAdded,
[this, &contactModel, &accInfo](const std::string& contactUri) {
[this, accountId](const std::string& contactUri) {
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId);
auto convModel = LRCInstance::getCurrentConversationModel();
auto conversation = LRCInstance::getCurrentConversation();
if (conversation.uid.empty()) {
return;
}
if (contactUri == contactModel.get()->getContact(conversation.participants.at(0)).profileInfo.uri) {
if (contactUri == accInfo.contactModel->getContact(conversation.participants.at(0)).profileInfo.uri) {
// update call screen
auto avatarImg = QPixmap::fromImage(imageForConv(conversation.uid));
ui->callingPhoto->setPixmap(avatarImg);
......@@ -1370,8 +1379,17 @@ CallWidget::connectAccount(const std::string& accId)
ui->messageView->printHistory(*convModel, conversation.interactions);
}
});
QObject::disconnect(addedToConferenceConnection_);
addedToConferenceConnection_ = QObject::connect(
accInfo.callModel.get(),
&NewCallModel::callAddedToConference,
[this](const std::string& callId, const std::string& confId) {
Q_UNUSED(callId);
LRCInstance::renderer()->addDistantRenderer(confId);
ui->videoView->updateCall();
});
} catch (...) {
qWarning() << "Couldn't get account: " << accId.c_str();
qWarning() << "Couldn't get account: " << accountId.c_str();
}
}
......
......@@ -164,5 +164,6 @@ private:
QMetaObject::Connection interactionRemovedConnection_;
QMetaObject::Connection contactAddedConnection_;
QMetaObject::Connection callStatusChangedConnection_;
QMetaObject::Connection addedToConferenceConnection_;
};
......@@ -27,7 +27,7 @@
ContactPicker::ContactPicker(QWidget *parent) :
QDialog(parent),
ui(new Ui::ContactPicker),
type_(Type::CONFERENCE)
listModeltype_(SmartListModel::Type::CONFERENCE)
{
ui->setupUi(this);
......@@ -58,24 +58,34 @@ ContactPicker::on_smartList_clicked(const QModelIndex &index)
void
ContactPicker::accept()
{
auto idx = ui->smartList->currentIndex();
if (idx.isValid()) {
// get current call id and peer uri
auto conversation = LRCInstance::getCurrentConversation();
if (conversation.uid.empty()) {
return;
}
auto thisCallId = conversation.callId;
auto contactUri = idx.data(static_cast<int>(SmartListModel::Role::URI)).value<QString>().toStdString();
auto index = ui->smartList->currentIndex();
if (index.isValid()) {
// let parent deal with this as this dialog will be destroyed
switch (type_) {
case Type::CONFERENCE:
emit contactWillJoinConference(thisCallId, contactUri);
switch (listModeltype_) {
case SmartListModel::Type::CONFERENCE:
{
auto sectionName = index.data(SmartListModel::Role::SectionName).value<QString>();
if (!sectionName.isEmpty()) {
smartListModel_->toggleSection(sectionName);
return;
}
auto convUid = index.data(SmartListModel::Role::UID).value<QString>().toStdString();
auto accId = index.data(SmartListModel::Role::AccountId).value<QString>().toStdString();
auto callId = LRCInstance::getCallIdForConversationUid(convUid, accId);
if (!callId.empty()) {
emit callWillJoinConference(callId);
} else {
auto contactUri = index.data(SmartListModel::Role::URI).value<QString>().toStdString();
emit contactWillJoinConference(contactUri);
}
}
break;
case Type::TRANSFER:
emit contactWillDoTransfer(thisCallId, contactUri);
case SmartListModel::Type::TRANSFER:
{
auto contactUri = index.data(SmartListModel::Role::URI).value<QString>().toStdString();
emit contactWillDoTransfer(contactUri);
}
break;
default:
break;
......@@ -88,6 +98,9 @@ ContactPicker::accept()
void
ContactPicker::on_ringContactLineEdit_textChanged(const QString &arg1)
{
if (listModeltype_ == SmartListModel::Type::CONFERENCE) {
smartListModel_->setConferenceableFilter(arg1.toStdString());
}
selectableProxyModel_->setFilterRegExp(QRegExp(arg1, Qt::CaseInsensitive, QRegExp::FixedString));
}
......@@ -107,29 +120,20 @@ ContactPicker::setTitle(const QString& title)
}
void
ContactPicker::setType(const Type& type)
ContactPicker::setType(const SmartListModel::Type& type)
{
type_ = type;
smartListModel_.reset(new SmartListModel(LRCInstance::getCurrAccId(), this, true));
listModeltype_ = type;
smartListModel_.reset(new SmartListModel(LRCInstance::getCurrAccId(), this, type, LRCInstance::getCurrentConvUid()));
selectableProxyModel_->setSourceModel(smartListModel_.get());
// adjust filter
switch (type_) {
case Type::CONFERENCE:
switch (listModeltype_) {
case SmartListModel::Type::CONFERENCE:
selectableProxyModel_->setPredicate(
[this](const QModelIndex& index, const QRegExp& regexp) {
bool match = regexp.indexIn(index.data(Qt::DisplayRole).toString()) != -1;
auto convUid = index.data(static_cast<int>(SmartListModel::Role::UID)).value<QString>().toStdString();
auto conversation = LRCInstance::getConversationFromConvUid(convUid);
if (conversation.uid.empty()) {
return false;
}
auto callModel = LRCInstance::getCurrentCallModel();
return match &&
!(callModel->hasCall(conversation.callId) || callModel->hasCall(conversation.confId)) &&
!index.parent().isValid();
[this](const QModelIndex&, const QRegExp&) {
return true;
});
break;
case Type::TRANSFER:
case SmartListModel::Type::TRANSFER:
selectableProxyModel_->setPredicate(
[this](const QModelIndex& index, const QRegExp& regexp) {
// Regex to remove current callee
......
......@@ -19,13 +19,13 @@
#pragma once
#include <QDialog>
#include <QSortFilterProxyModel>
#include "smartlistmodel.h"
#include "utils.h"
#include "lrcinstance.h"
#include <QDialog>
#include <QSortFilterProxyModel>
namespace Ui {
class ContactPicker;
}
......@@ -61,24 +61,19 @@ class ContactPicker : public QDialog
Q_OBJECT;
public:
enum class Type {
CONFERENCE,
TRANSFER,
COUNT__
};
explicit ContactPicker(QWidget *parent = 0);
~ContactPicker();
void setTitle(const QString& title);
void setType(const Type& type);
void setType(const SmartListModel::Type& type);
void setCurrentCalleeDisplayName(const QString& CalleeDisplayName);
protected:
void mousePressEvent(QMouseEvent *event);
signals:
void contactWillJoinConference(const std::string& callId, const std::string& contactUri);
void contactWillDoTransfer(const std::string& callId, const std::string& contactUri);
void contactWillJoinConference(const std::string& contactUri);
void callWillJoinConference(const std::string& callId);
void contactWillDoTransfer(const std::string& contactUri);
void willClose(QMouseEvent *event);
protected slots:
......@@ -93,7 +88,7 @@ private:
std::unique_ptr<SmartListModel> smartListModel_;
SelectableProxyModel* selectableProxyModel_;
Type type_;
QString CalleeDisplayName_;
SmartListModel::Type listModeltype_;
};
......@@ -57,6 +57,29 @@ ContactPickerItemDelegate::paint(QPainter* painter
highlightMap_[index.row()] = option.state & QStyle::State_MouseOver;
}
QRect &rect = opt.rect;
QString sectionName = index.data(static_cast<int>(SmartListModel::Role::SectionName)).value<QString>();
if (!sectionName.isEmpty()) {
painter->fillRect(option.rect, RingTheme::lightGrey_);
QFont font(painter->font());
QPen pen(painter->pen());
auto scalingRatio = MainWindow::instance().getCurrentScalingRatio();
if (scalingRatio > 1.0) {
font.setPointSize(fontSize_ - 2);
} else {
font.setPointSize(fontSize_);
}
font.setItalic(false);
font.setBold(false);
pen.setColor(RingTheme::lightBlack_);
painter->setPen(pen);
painter->setFont(font);
QMargins padding(4, 0, 0, 0);
painter->drawText(rect - padding, Qt::AlignVCenter | Qt::AlignLeft, sectionName);
return;
}
QColor presenceBorderColor = Qt::white;
auto rowHighlight = highlightMap_.find(index.row());
if (selected) {
......@@ -67,8 +90,6 @@ ContactPickerItemDelegate::paint(QPainter* painter
presenceBorderColor = RingTheme::smartlistHighlight_;
}
QRect &rect = opt.rect;
// Avatar drawing
opt.decorationSize = QSize(sizeImage_, sizeImage_);
opt.decorationPosition = QStyleOptionViewItem::Left;
......@@ -117,7 +138,11 @@ ContactPickerItemDelegate::sizeHint(const QStyleOptionViewItem& option,
const QModelIndex& index) const
{
Q_UNUSED(option);
Q_UNUSED(index);
if (!index.data(static_cast<int>(SmartListModel::Role::SectionName))
.value<QString>()
.isEmpty()) {
return QSize(0, sectionCellHeight_);
}
return QSize(0, cellHeight_);
}
......@@ -130,7 +155,6 @@ ContactPickerItemDelegate::paintRingContactItem(QPainter* painter,
Q_UNUSED(option);
QFont font(painter->font());
QPen pen(painter->pen());
painter->setPen(pen);
auto scalingRatio = MainWindow::instance().getCurrentScalingRatio();
if (scalingRatio > 1.0) {
......
......@@ -39,6 +39,7 @@ private:
constexpr static int sizeImage_ = 48;
constexpr static int cellHeight_ = 60;
constexpr static int sectionCellHeight_ = 24;
constexpr static int dy_ = 6;
constexpr static int dx_ = 12;
constexpr static int fontSize_ = 11;
......
......@@ -122,15 +122,37 @@ public:
}
return result;
};
static std::string
getCallIdForConversationUid(const std::string& convUid, const std::string& accountId)
{
auto convInfo = LRCInstance::getConversationFromConvUid(convUid, accountId);
if (convInfo.uid.empty()) {
return {};
}
return convInfo.confId.empty() ? convInfo.callId : convInfo.confId;
}
static const call::Info*
getCallInfo(const std::string& callId, const std::string& accountId) {
try {
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId);
if (!accInfo.callModel->hasCall(callId)) {
return nullptr;
}
return &accInfo.callModel->getCall(callId);
} catch (...) {
return nullptr;
}
}
static const call::Info*
getCallInfoForConversation(const conversation::Info& convInfo) {
try {
auto accountId = convInfo.accountId;
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId);
if (!accInfo.callModel->hasCall(convInfo.callId)) {
auto callId = convInfo.confId.empty() ? convInfo.callId : convInfo.confId;
if (!accInfo.callModel->hasCall(callId)) {
return nullptr;
}
return &accInfo.callModel->getCall(convInfo.callId);
return &accInfo.callModel->getCall(callId);
} catch(...) {
return nullptr;
}
......@@ -194,7 +216,7 @@ public:
}
static const conversation::Info&
getCurrentConversation() {
return getConversationFromConvUid(getSelectedConvUid());
return getConversationFromConvUid(getCurrentConvUid());
}
static ConversationModel*
......@@ -221,7 +243,7 @@ public:
settings.setValue(SettingsKey::selectedAccount, QString::fromStdString(accountId));
};
static const std::string& getSelectedConvUid() {
static const std::string& getCurrentConvUid() {
return instance().selectedConvUid_;
};
......
......@@ -418,7 +418,7 @@ PrivateBridging::deleteInteraction(const QString& arg)
uint64_t interactionUid = arg.toULongLong(&ok);
if (ok) {
LRCInstance::getCurrentConversationModel()->clearInteractionFromConversation(
LRCInstance::getSelectedConvUid(),
LRCInstance::getCurrentConvUid(),
interactionUid
);
} else {
......@@ -434,7 +434,7 @@ PrivateBridging::retryInteraction(const QString& arg)
uint64_t interactionUid = arg.toULongLong(&ok);
if (ok) {
LRCInstance::getCurrentConversationModel()->retryInteraction(
LRCInstance::getSelectedConvUid(),
LRCInstance::getCurrentConvUid(),
interactionUid
);
} else {
......@@ -461,7 +461,7 @@ PrivateBridging::acceptFile(const QString& arg)
auto interactionUid = std::stoull(arg.toStdString());
lrc::api::datatransfer::Info info = {};
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->getTransferInfo(interactionUid, info);
// get full path
......@@ -490,7 +490,7 @@ PrivateBridging::refuseFile(const QString& arg)
{
try {
auto interactionUid = std::stoull(arg.toStdString());
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->cancelTransfer(convUid, interactionUid);
} catch (...) {
qDebug() << "JS bridging - exception during refuseFile:" << arg;
......@@ -502,7 +502,7 @@ Q_INVOKABLE int
PrivateBridging::sendMessage(const QString& arg)
{
try {
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->sendMessage(convUid, arg.toStdString());
} catch (...) {
qDebug() << "JS bridging - exception during sendMessage:" << arg;
......@@ -533,7 +533,7 @@ PrivateBridging::sendImage(const QString& arg)
}
try {
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->sendFile(convUid, path.toStdString(), fileName.toStdString());
} catch (...) {
qDebug().noquote() << "JS bridging - exception during sendFile - base64 img" << "\n";
......@@ -545,7 +545,7 @@ PrivateBridging::sendImage(const QString& arg)
QFileInfo fi(arg);
QString fileName = fi.fileName();
try {
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->sendFile(convUid, arg.toStdString(), fileName.toStdString());
} catch (...) {
qDebug().noquote() << "JS bridging - exception during sendFile - image from path" << "\n";
......@@ -562,7 +562,7 @@ PrivateBridging::sendFile(const QString&path)
QFileInfo fi(path);
QString fileName = fi.fileName();
try {
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->sendFile(convUid, path.toStdString(), fileName.toStdString());
} catch (...) {
qDebug() << "JS bridging - exception during sendFile";
......@@ -604,7 +604,7 @@ Q_INVOKABLE int
PrivateBridging::refuseInvitation()
{
try {
auto convUid = LRCInstance::getSelectedConvUid();
auto convUid = LRCInstance::getCurrentConvUid();
LRCInstance::getCurrentConversationModel()->removeConversation(convUid, false);
if (auto messageView = qobject_cast<MessageWebView*>(this->parent())) {
messageView->setInvitation(false);
......@@ -620,7 +620,7 @@ Q_INVOKABLE int