Commit 1fd183de authored by Ming Rui Zhang's avatar Ming Rui Zhang

callwidget: hide sendContactRequest button when user use similar technique

Change-Id: Ifa58c94d6c4ab789489ab63b08112bfb0c08ee91
parent 077791ba
......@@ -181,6 +181,13 @@ CallWidget::CallWidget(QWidget* parent) :
connect(ui->messageView, &MessageWebView::pasteKeyDetected,
this, &CallWidget::Paste);
connect(ui->messageView, &MessageWebView::invitationAccepted,
[this] {
auto convUid = LRCInstance::getSelectedConvUid();
LRCInstance::getCurrentConversationModel()->makePermanent(convUid);
ui->sendContactRequestButton->hide();
});
// video view
connect(ui->videoView, &VideoView::setChatVisibility,
this, &CallWidget::slotSetChatVisibility, Qt::DirectConnection);
......@@ -617,6 +624,7 @@ CallWidget::slotAcceptInviteClicked(const QModelIndex & index)
auto convUid = index.data(static_cast<int>(SmartListModel::Role::UID)).value<QString>().toStdString();
LRCInstance::getCurrentConversationModel()->makePermanent(convUid);
ui->messageView->setInvitation(false);
ui->sendContactRequestButton->hide();
}
void
......
......@@ -591,9 +591,7 @@ Q_INVOKABLE int
PrivateBridging::acceptInvitation()
{
try {
auto convUid = LRCInstance::getSelectedConvUid();
LRCInstance::getCurrentConversationModel()->makePermanent(convUid);
qobject_cast<MessageWebView*>(this->parent())->setInvitation(false);
emit qobject_cast<MessageWebView*>(this->parent())->invitationAccepted();
} catch (...) {
qDebug() << "JS bridging - exception during acceptInvitation";
}
......
......@@ -103,6 +103,7 @@ signals:
void messagesLoaded();
void textSelectedReady();
void pasteKeyDetected();
void invitationAccepted();
private slots:
void slotLoadFinished();
......
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