Skip to content
Snippets Groups Projects
Commit 4b4bfde4 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

videoview: move conversation connection to callwidget

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

Change-Id: I3b71411bf3493c7831071c51c0b0d3fa30e92f76
parent 625521e1
No related branches found
No related tags found
No related merge requests found
...@@ -1021,6 +1021,12 @@ CallWidget::connectConversationModel() ...@@ -1021,6 +1021,12 @@ CallWidget::connectConversationModel()
currentConversationModel, &lrc::api::ConversationModel::newInteraction, currentConversationModel, &lrc::api::ConversationModel::newInteraction,
[this](const std::string& convUid, uint64_t interactionId, const lrc::api::interaction::Info& interaction) { [this](const std::string& convUid, uint64_t interactionId, const lrc::api::interaction::Info& interaction) {
onIncomingMessage(convUid, interactionId, interaction); onIncomingMessage(convUid, interactionId, interaction);
if (interaction.type == lrc::api::interaction::Type::CALL) {
return;
}
if (convUid == selectedConvUid()) {
ui->videoWidget->simulateShowChatview(true);
}
} }
); );
interactionRemovedConnection_ = QObject::connect( interactionRemovedConnection_ = QObject::connect(
......
...@@ -70,20 +70,6 @@ VideoView::VideoView(QWidget* parent) : ...@@ -70,20 +70,6 @@ VideoView::VideoView(QWidget* parent) :
emit this->setChatVisibility(visible); emit this->setChatVisibility(visible);
}); });
connect(overlay_, &VideoOverlay::videoCfgBtnClicked, [=](){emit videoSettingsClicked();}); 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() VideoView::~VideoView()
...@@ -189,6 +175,12 @@ VideoView::showChatviewIfToggled() ...@@ -189,6 +175,12 @@ VideoView::showChatviewIfToggled()
emit setChatVisibility(overlay_->getShowChatView()); emit setChatVisibility(overlay_->getShowChatView());
} }
void
VideoView::simulateShowChatview(bool checked)
{
overlay_->simulateShowChatview(true);
}
void void
VideoView::updateCall() VideoView::updateCall()
{ {
......
...@@ -43,6 +43,7 @@ public: ...@@ -43,6 +43,7 @@ public:
~VideoView(); ~VideoView();
void pushRenderer(const std::string& callUid); void pushRenderer(const std::string& callUid);
void showChatviewIfToggled(); void showChatviewIfToggled();
void simulateShowChatview(bool checked);
protected: protected:
void resizeEvent(QResizeEvent* event); void resizeEvent(QResizeEvent* event);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment