From c51324864d66fc07b3e67a50163b711f9571358d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Thu, 27 Aug 2020 17:30:42 -0400 Subject: [PATCH] rendezvous: the host can change the layout until we can set another account as the master Change-Id: Ia4f6d72a4341d036dd20c60d06cb171b236bdcf7 --- src/conversationmodel.cpp | 12 +++++++++++- src/newcallmodel.cpp | 23 +++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp index cf3416fe..ff927202 100644 --- a/src/conversationmodel.cpp +++ b/src/conversationmodel.cpp @@ -613,6 +613,12 @@ ConversationModel::selectConversation(const QString& uid) const callEnded = call.status == call::Status::ENDED; } catch (...) {} } + if (!conversation.confId.isEmpty() + && owner.confProperties.isRendezVous) { + // If we are on a rendez vous account and we select the conversation, + // attach to the call. + CallManager::instance().unholdConference(conversation.confId); + } if (not callEnded and not conversation.confId.isEmpty()) { emit pimpl_->behaviorController.showCallView(owner.id, conversation); @@ -1946,7 +1952,11 @@ ConversationModelPimpl::slotCallAddedToConference(const QString& callId, const Q if (conversation.callId == callId || conversation.confId == confId) { conversation.confId = confId; dirtyConversations = {true, true}; - emit linked.selectConversation(conversation.uid); + + // Refresh the conference status only if attached + MapStringString confDetails = CallManager::instance().getConferenceDetails(confId); + if (confDetails["STATE"] == "ACTIVE_ATTACHED") + emit linked.selectConversation(conversation.uid); } } } diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp index ec7a1912..8bf3d008 100644 --- a/src/newcallmodel.cpp +++ b/src/newcallmodel.cpp @@ -705,11 +705,12 @@ NewCallModelPimpl::slotIncomingCall(const QString& accountId, const QString& cal if (linked.owner.id != accountId) { return; } - if (linked.owner.confProperties.isRendezVous) { - // Do not notify for calls if rendez vous because it's in a detached - // mode and auto answer is managed by the daemon - return; - } + // TODO: uncomment this. For now, the rendez-vous account is showing calls + //if (linked.owner.confProperties.isRendezVous) { + // // Do not notify for calls if rendez vous because it's in a detached + // // mode and auto answer is managed by the daemon + // return; + //} // do not use auto here (QDBusPendingReply<MapStringString>) MapStringString callDetails = CallManager::instance().getCallDetails(callId); @@ -775,8 +776,10 @@ NewCallModelPimpl::slotCallStateChanged(const QString& callId, const QString& st || previousStatus == call::Status::OUTGOING_RINGING) { if (previousStatus == call::Status::INCOMING_RINGING - && linked.owner.profileInfo.type != profile::Type::SIP) + && linked.owner.profileInfo.type != profile::Type::SIP + && !linked.owner.confProperties.isRendezVous) { // TODO remove this when we want to not show calls in rendez-vous linked.setCurrentCall(callId); + } call->startTime = std::chrono::steady_clock::now(); emit linked.callStarted(callId); sendProfile(callId); @@ -861,6 +864,14 @@ NewCallModelPimpl::slotOnConferenceInfosUpdated(const QString& confId, const Vec } emit linked.onParticipantsChanged(confId); + + // TODO: remove when the rendez-vous UI will be done + // For now, the rendez-vous account can see ongoing calls + // And must be notified when a new + QStringList callList = CallManager::instance().getParticipantList(confId); + foreach(const auto& call, callList) { + emit linked.callAddedToConference(call, confId); + } } bool -- GitLab