mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2025-12-16 14:41:25 +08:00
conference: fix host client leaving conference on peer disconnect
* Implements similar logic to that of patch 32322 in slotOnConferenceInfosUpdated to fall back to suitable conversation when necessary GitLab: #2130 Change-Id: Id8ce91403602198499f5e8bda65ce4e3560b014b
This commit is contained in:
@@ -1639,6 +1639,7 @@ CallModelPimpl::slotOnConferenceInfosUpdated(const QString& confId, const Vector
|
||||
// For now, the rendez-vous account can see ongoing calls
|
||||
// And must be notified when a new
|
||||
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
|
||||
qDebug() << "[conf:" << confId << "] Conference infos updated. Calls remaining:" << callList.size();
|
||||
Q_FOREACH (const auto& call, callList) {
|
||||
Q_EMIT linked.callAddedToConference(call, "", confId);
|
||||
if (calls.find(call) == calls.end()) {
|
||||
@@ -1658,6 +1659,21 @@ CallModelPimpl::slotOnConferenceInfosUpdated(const QString& confId, const Vector
|
||||
participantIt->second->update(infos);
|
||||
it->second->layout = participantIt->second->getLayout();
|
||||
|
||||
// Check if we need to switch conversation
|
||||
auto currentConversation = linked.owner.conversationModel->getConversationForCallId(confId);
|
||||
if (currentConversation && callList.size() >= 2 && participantIt != participantsModel.end()) {
|
||||
qDebug() << "[conf:" << confId << "] Checking if client should switch to another conversation";
|
||||
auto fallbackConversation = getFallbackConversationForConference(confId);
|
||||
// If fallback conversation is not nullopt, switch to it
|
||||
if (fallbackConversation) {
|
||||
currentConversation->get().confId.clear();
|
||||
fallbackConversation->get().confId = confId;
|
||||
fallbackConversation->get().callId = confId;
|
||||
linked.owner.conversationModel->selectConversation(fallbackConversation->get().uid);
|
||||
qWarning() << "[conf:" << confId << "] Selected fallback conversation:" << fallbackConversation->get().uid;
|
||||
}
|
||||
}
|
||||
|
||||
// if Jami, remove @ring.dht
|
||||
for (auto& i : participantIt->second->getParticipants()) {
|
||||
i.uri.replace("@ring.dht", "");
|
||||
|
||||
Reference in New Issue
Block a user