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
}
#ifdef ENABLE_LIBWRAP
auto callId = CallManager::instance().placeCallWithMedia(owner.id, uri, mediaList);
#else // dbus
#else // dbus
// do not use auto here (QDBusPendingReply<QString>)
QString callId = CallManager::instance().placeCallWithMedia(owner.id, uri, mediaList);
#endif // ENABLE_LIBWRAP
......@@ -568,9 +568,12 @@ CallModel::addMedia(const QString& callId, const QString& source, MediaRequestTy
// video or if a new sharing is requested
if (isConf) {
replace &= media[MediaAttributeKey::MUTED] == TRUE_STR;
replace |= (media[MediaAttributeKey::SOURCE].startsWith(libjami::Media::VideoProtocolPrefix::FILE)
|| media[MediaAttributeKey::SOURCE].startsWith(libjami::Media::VideoProtocolPrefix::DISPLAY))
&& (type == MediaRequestType::FILESHARING || type == MediaRequestType::SCREENSHARING);
replace |= (media[MediaAttributeKey::SOURCE].startsWith(
libjami::Media::VideoProtocolPrefix::FILE)
|| media[MediaAttributeKey::SOURCE].startsWith(
libjami::Media::VideoProtocolPrefix::DISPLAY))
&& (type == MediaRequestType::FILESHARING
|| type == MediaRequestType::SCREENSHARING);
}
if (replace) {
mediaAttribute[MediaAttributeKey::LABEL] = media[MediaAttributeKey::LABEL];
......@@ -967,9 +970,9 @@ CallModel::getDisplay(const QString& windowProcessId, const QString& windowId)
#endif
#ifdef WIN32
ret = QString("%1%2:+0,0 window-id:hwnd=%3")
.arg(libjami::Media::VideoProtocolPrefix::DISPLAY)
.arg(sep)
.arg(windowProcessId);
.arg(libjami::Media::VideoProtocolPrefix::DISPLAY)
.arg(sep)
.arg(windowProcessId);
#endif
return ret;
}
......@@ -1702,6 +1705,7 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
calls[confId] = callInfo;
QString currentCallId = currentCall_;
Q_FOREACH (const auto& call, callList) {
Q_EMIT linked.callAddedToConference(call, confId);
// Remove call from pendingConferences_
......@@ -1713,7 +1717,11 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
break;
}
}
if (call == currentCall_)
currentCall_ = confId;
}
if (currentCallId != currentCall_)
Q_EMIT linked.currentCallChanged(confId);
}
void
......@@ -1725,9 +1733,14 @@ CallModelPimpl::slotConferenceChanged(const QString& accountId,
return;
// Detect if conference is created for this account
QStringList callList = CallManager::instance().getParticipantList(linked.owner.id, confId);
QString currentCallId = currentCall_;
Q_FOREACH (const auto& call, callList) {
Q_EMIT linked.callAddedToConference(call, confId);
if (call == currentCall_)
currentCall_ = confId;
}
if (currentCallId != currentCall_)
Q_EMIT linked.currentCallChanged(confId);
}
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