Skip to content
Snippets Groups Projects
Commit ccb412c6 authored by Sébastien Blin's avatar Sébastien Blin Committed by Ming Rui Zhang
Browse files

calladapter: fix preview when switching account

Gitlab: #310

Change-Id: I0a45f24e87b4baba16c5a8172c0aae705745e30f
parent 1d026c7b
No related branches found
No related tags found
No related merge requests found
......@@ -251,7 +251,7 @@ CallAdapter::shouldShowPreview(bool force)
auto call = LRCInstance::getCallInfoForConversation(convInfo, force);
if (call) {
shouldShowPreview = !call->isAudioOnly && !(call->status == lrc::api::call::Status::PAUSED)
&& !call->videoMuted && call->type != lrc::api::call::Type::CONFERENCE;
&& !call->videoMuted && call->participantsInfos.isEmpty();
}
return shouldShowPreview;
}
......@@ -280,10 +280,10 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant)
data["avatar"] = accInfo.profileInfo.avatar;
} else {
try {
auto& contact = LRCInstance::getCurrentAccountInfo()
.contactModel->getContact(participant["uri"]);
bestName = LRCInstance::getCurrentAccountInfo()
.contactModel->bestNameForContact(participant["uri"]);
auto& contact = LRCInstance::getCurrentAccountInfo().contactModel->getContact(
participant["uri"]);
bestName = LRCInstance::getCurrentAccountInfo().contactModel->bestNameForContact(
participant["uri"]);
if (participant["videoMuted"] == "true")
data["avatar"] = contact.profileInfo.avatar;
......@@ -295,7 +295,6 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant)
return data;
}
QVariantList
CallAdapter::getConferencesInfos()
{
......@@ -349,8 +348,8 @@ CallAdapter::connectCallModel(const QString& accountId)
QObject::disconnect(callStatusChangedConnection_);
QObject::disconnect(onParticipantsChangedConnection_);
onParticipantsChangedConnection_ = QObject::connect(
accInfo.callModel.get(),
onParticipantsChangedConnection_
= QObject::connect(accInfo.callModel.get(),
&lrc::api::NewCallModel::onParticipantsChanged,
[this, accountId](const QString& confId) {
auto& accInfo = LRCInstance::accountModel().getAccountInfo(accountId);
......@@ -458,8 +457,8 @@ CallAdapter::connectCallModel(const QString& accountId)
accInfo.callModel.get(),
&lrc::api::NewCallModel::remoteRecordingChanged,
[this](const QString& callId, const QSet<QString>& peerRec, bool state) {
const auto currentCallId =
LRCInstance::getCallIdForConversationUid(convUid_, accountId_);
const auto currentCallId = LRCInstance::getCallIdForConversationUid(convUid_,
accountId_);
if (callId == currentCallId) {
const auto& accInfo = LRCInstance::getCurrentAccountInfo();
QStringList peers {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment