Skip to content
Snippets Groups Projects
Commit 4ba64178 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

callmodel: update current call on conference creation

If a call starts in a swarm, the host must show the confId.
The current call wasn't updated when a call is upgraded to a conference
causing the wrong call to be shown due to the new logic

Change-Id: I990d39e6e04253bc087fd0ec73c5b6c7906f93d9
parent 50ad6c50
No related branches found
No related tags found
No related merge requests found
...@@ -400,7 +400,7 @@ CallModel::createCall(const QString& uri, bool isAudioOnly, VectorMapStringStrin ...@@ -400,7 +400,7 @@ CallModel::createCall(const QString& uri, bool isAudioOnly, VectorMapStringStrin
} }
#ifdef ENABLE_LIBWRAP #ifdef ENABLE_LIBWRAP
auto callId = CallManager::instance().placeCallWithMedia(owner.id, uri, mediaList); auto callId = CallManager::instance().placeCallWithMedia(owner.id, uri, mediaList);
#else // dbus #else // dbus
// do not use auto here (QDBusPendingReply<QString>) // do not use auto here (QDBusPendingReply<QString>)
QString callId = CallManager::instance().placeCallWithMedia(owner.id, uri, mediaList); QString callId = CallManager::instance().placeCallWithMedia(owner.id, uri, mediaList);
#endif // ENABLE_LIBWRAP #endif // ENABLE_LIBWRAP
...@@ -568,9 +568,12 @@ CallModel::addMedia(const QString& callId, const QString& source, MediaRequestTy ...@@ -568,9 +568,12 @@ CallModel::addMedia(const QString& callId, const QString& source, MediaRequestTy
// video or if a new sharing is requested // video or if a new sharing is requested
if (isConf) { if (isConf) {
replace &= media[MediaAttributeKey::MUTED] == TRUE_STR; replace &= media[MediaAttributeKey::MUTED] == TRUE_STR;
replace |= (media[MediaAttributeKey::SOURCE].startsWith(libjami::Media::VideoProtocolPrefix::FILE) replace |= (media[MediaAttributeKey::SOURCE].startsWith(
|| media[MediaAttributeKey::SOURCE].startsWith(libjami::Media::VideoProtocolPrefix::DISPLAY)) libjami::Media::VideoProtocolPrefix::FILE)
&& (type == MediaRequestType::FILESHARING || type == MediaRequestType::SCREENSHARING); || media[MediaAttributeKey::SOURCE].startsWith(
libjami::Media::VideoProtocolPrefix::DISPLAY))
&& (type == MediaRequestType::FILESHARING
|| type == MediaRequestType::SCREENSHARING);
} }
if (replace) { if (replace) {
mediaAttribute[MediaAttributeKey::LABEL] = media[MediaAttributeKey::LABEL]; mediaAttribute[MediaAttributeKey::LABEL] = media[MediaAttributeKey::LABEL];
...@@ -967,9 +970,9 @@ CallModel::getDisplay(const QString& windowProcessId, const QString& windowId) ...@@ -967,9 +970,9 @@ CallModel::getDisplay(const QString& windowProcessId, const QString& windowId)
#endif #endif
#ifdef WIN32 #ifdef WIN32
ret = QString("%1%2:+0,0 window-id:hwnd=%3") ret = QString("%1%2:+0,0 window-id:hwnd=%3")
.arg(libjami::Media::VideoProtocolPrefix::DISPLAY) .arg(libjami::Media::VideoProtocolPrefix::DISPLAY)
.arg(sep) .arg(sep)
.arg(windowProcessId); .arg(windowProcessId);
#endif #endif
return ret; return ret;
} }
...@@ -1702,6 +1705,7 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c ...@@ -1702,6 +1705,7 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
calls[confId] = callInfo; calls[confId] = callInfo;
QString currentCallId = currentCall_;
Q_FOREACH (const auto& call, callList) { Q_FOREACH (const auto& call, callList) {
Q_EMIT linked.callAddedToConference(call, confId); Q_EMIT linked.callAddedToConference(call, confId);
// Remove call from pendingConferences_ // Remove call from pendingConferences_
...@@ -1713,7 +1717,11 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c ...@@ -1713,7 +1717,11 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
break; break;
} }
} }
if (call == currentCall_)
currentCall_ = confId;
} }
if (currentCallId != currentCall_)
Q_EMIT linked.currentCallChanged(confId);
} }
void void
...@@ -1725,9 +1733,14 @@ CallModelPimpl::slotConferenceChanged(const QString& accountId, ...@@ -1725,9 +1733,14 @@ CallModelPimpl::slotConferenceChanged(const QString& accountId,
return; return;
// Detect if conference is created for this account // Detect if conference is created for this account
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId); QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
QString currentCallId = currentCall_;
Q_FOREACH (const auto& call, callList) { Q_FOREACH (const auto& call, callList) {
Q_EMIT linked.callAddedToConference(call, confId); Q_EMIT linked.callAddedToConference(call, confId);
if (call == currentCall_)
currentCall_ = confId;
} }
if (currentCallId != currentCall_)
Q_EMIT linked.currentCallChanged(confId);
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment