Commit 2de13a70 authored by Ming Rui Zhang's avatar Ming Rui Zhang

videoview: fix the issue where avatar does not hide when call is on hold

Change-Id: Ia9b6909ce2f41906127cf5edb0c785bf1e6c9fea
parent 5186b079
......@@ -56,7 +56,7 @@ CallAudioOnlyAvatarOverlay::writeAvatarOverlay(const lrc::api::conversation::Inf
}
void
CallAudioOnlyAvatarOverlay::respondToPauseLabel(bool pauseButtonDisplayed)
CallAudioOnlyAvatarOverlay::respondToPauseLabel(bool isPaused)
{
setAvatarVisible(!pauseButtonDisplayed);
setAvatarVisible(!isPaused);
}
......@@ -38,7 +38,7 @@ public:
~CallAudioOnlyAvatarOverlay();
void setAvatarVisible(bool visible);
void writeAvatarOverlay(const lrc::api::conversation::Info& convInfo);
void respondToPauseLabel(bool pauseButtonDisplayed);
void respondToPauseLabel(bool isPaused);
private:
Ui::CallAudioOnlyAvatarOverlay *ui;
......
......@@ -191,19 +191,15 @@ VideoOverlay::on_chatButton_toggled(bool checked)
void
VideoOverlay::on_holdButton_toggled(bool checked)
{
// why is 'checked' unused?
Q_UNUSED(checked);
auto callId = LRCInstance::getCallIdForConversationUid(convUid_, accountId_);
if (callId.isEmpty() || !LRCInstance::getCurrentCallModel()->hasCall(callId)) {
return;
}
auto callModel = LRCInstance::getCurrentCallModel();
bool onHold { false };
if (callModel->hasCall(callId)) {
callModel->togglePause(callId);
onHold = callModel->getCall(callId).status == lrc::api::call::Status::PAUSED;
}
ui->onHoldLabel->setVisible(onHold);
}
void
......
......@@ -55,7 +55,6 @@ public:
signals:
void setChatVisibility(bool visible);
void holdStateChanged(bool state);
void videoMuteStateChanged(bool state);
private:
......
......@@ -304,8 +304,9 @@ VideoView::updateCall(const QString& convUid,
}
overlay_->updateCall(convInfo);
auto isPaused = call->status == lrc::api::call::Status::PAUSED;
// TODO(atraczyk): this should be part of the overlay
audioOnlyAvatar_->setAvatarVisible(call->isAudioOnly);
audioOnlyAvatar_->setAvatarVisible(call->isAudioOnly && !isPaused);
if (call->isAudioOnly) {
audioOnlyAvatar_->writeAvatarOverlay(convInfo);
}
......@@ -315,7 +316,6 @@ VideoView::updateCall(const QString& convUid,
// distant
ui->distantWidget->setRendererId(call->id);
auto isPaused = call->status == lrc::api::call::Status::PAUSED;
ui->distantWidget->setVisible(!isPaused);
}
......
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