Commit 4b4bfde4 authored by Andreas Traczyk's avatar Andreas Traczyk

videoview: move conversation connection to callwidget

Fixes crash when no accounts are available, and reconnects signal
when account changes.

Change-Id: I3b71411bf3493c7831071c51c0b0d3fa30e92f76
parent 625521e1
......@@ -1021,6 +1021,12 @@ CallWidget::connectConversationModel()
currentConversationModel, &lrc::api::ConversationModel::newInteraction,
[this](const std::string& convUid, uint64_t interactionId, const lrc::api::interaction::Info& interaction) {
onIncomingMessage(convUid, interactionId, interaction);
if (interaction.type == lrc::api::interaction::Type::CALL) {
return;
}
if (convUid == selectedConvUid()) {
ui->videoWidget->simulateShowChatview(true);
}
}
);
interactionRemovedConnection_ = QObject::connect(
......
......@@ -70,20 +70,6 @@ VideoView::VideoView(QWidget* parent) :
emit this->setChatVisibility(visible);
});
connect(overlay_, &VideoOverlay::videoCfgBtnClicked, [=](){emit videoSettingsClicked();});
auto convModel = LRCInstance::getCurrentConversationModel();
connect(convModel, &lrc::api::ConversationModel::newInteraction,
[this](const std::string& uid, uint64_t, lrc::api::interaction::Info info) {
if (info.type == lrc::api::interaction::Type::CALL) {
return;
}
auto selectedConvUid = LRCInstance::getSelectedConvUid();
if (uid == selectedConvUid) {
overlay_->simulateShowChatview(true);
}
});
}
VideoView::~VideoView()
......@@ -189,6 +175,12 @@ VideoView::showChatviewIfToggled()
emit setChatVisibility(overlay_->getShowChatView());
}
void
VideoView::simulateShowChatview(bool checked)
{
overlay_->simulateShowChatview(true);
}
void
VideoView::updateCall()
{
......
......@@ -43,6 +43,7 @@ public:
~VideoView();
void pushRenderer(const std::string& callUid);
void showChatviewIfToggled();
void simulateShowChatview(bool checked);
protected:
void resizeEvent(QResizeEvent* event);
......
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