1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 12:03:18 +02:00

callmodel: keep only one shared source in call

Change-Id: I561db4414c92419946cc1f7233979b1cf8841055
GitLab: #960
This commit is contained in:
Aline Gondim Santos 2023-02-14 11:54:19 -03:00 committed by Sébastien Blin
parent 313b3bf2bd
commit cbdfe26dd1

View file

@ -565,9 +565,13 @@ CallModel::addMedia(const QString& callId, const QString& source, MediaRequestTy
for (auto& media : proposedList) {
auto replace = media[MediaAttributeKey::MEDIA_TYPE] == MediaAttributeValue::VIDEO;
// In a 1:1 we replace the first video, in a conference we replace only if it's a muted
// video as we show multiple previews
if (isConf)
// 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);
}
if (replace) {
mediaAttribute[MediaAttributeKey::LABEL] = media[MediaAttributeKey::LABEL];
media = mediaAttribute;