mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 14:55:43 +02:00
conference: fix participant overlay avatars
Gitlab: #466 Change-Id: Id7bd241c3c88dfba90505dd399127d5ceedbf028
This commit is contained in:
parent
417a0fe042
commit
92a3d03206
4 changed files with 14 additions and 22 deletions
|
@ -495,17 +495,10 @@ CallAdapter::fillParticipantData(QMap<QString, QString> participant)
|
||||||
if (bestName == accInfo.profileInfo.uri) {
|
if (bestName == accInfo.profileInfo.uri) {
|
||||||
bestName = tr("me");
|
bestName = tr("me");
|
||||||
data["isLocal"] = true;
|
data["isLocal"] = true;
|
||||||
if (participant["videoMuted"] == "true")
|
|
||||||
data["avatar"] = accInfo.profileInfo.avatar;
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
auto& contact = lrcInstance_->getCurrentAccountInfo().contactModel->getContact(
|
|
||||||
participant["uri"]);
|
|
||||||
bestName = lrcInstance_->getCurrentAccountInfo().contactModel->bestNameForContact(
|
bestName = lrcInstance_->getCurrentAccountInfo().contactModel->bestNameForContact(
|
||||||
participant["uri"]);
|
participant["uri"]);
|
||||||
if (participant["videoMuted"] == "true")
|
|
||||||
data["avatar"] = contact.profileInfo.avatar;
|
|
||||||
data["isContact"] = true;
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,20 +52,18 @@ Item {
|
||||||
|
|
||||||
z: 1
|
z: 1
|
||||||
|
|
||||||
function setAvatar(show, base64, uri, local, isContact) {
|
function setAvatar(show, uri, isLocal) {
|
||||||
if (!show)
|
if (!show)
|
||||||
contactImage.visible = false
|
avatar.visible = false
|
||||||
else {
|
else {
|
||||||
if (local) {
|
if (isLocal) {
|
||||||
contactImage.imageId = LRCInstance.currentAccountId
|
avatar.mode = Avatar.Mode.Account
|
||||||
} else if (isContact) {
|
avatar.imageId = LRCInstance.currentAccountId
|
||||||
contactImage.avatarMode = AvatarImage.AvatarMode.FromContactUri
|
|
||||||
contactImage.updateImage(uri)
|
|
||||||
} else {
|
} else {
|
||||||
contactImage.avatarMode = AvatarImage.AvatarMode.FromTemporaryName
|
avatar.mode = Avatar.Mode.Contact
|
||||||
contactImage.updateImage(uri)
|
avatar.imageId = uri
|
||||||
}
|
}
|
||||||
contactImage.visible = true
|
avatar.visible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +167,8 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConversationAvatar {
|
Avatar {
|
||||||
id: contactImage
|
id: avatar
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
height: Math.min(parent.width / 2, parent.height / 2)
|
height: Math.min(parent.width / 2, parent.height / 2)
|
||||||
|
|
|
@ -77,7 +77,7 @@ Item {
|
||||||
participantOverlays[p].setMenu(participant.uri, participant.bestName,
|
participantOverlays[p].setMenu(participant.uri, participant.bestName,
|
||||||
participant.isLocal, participant.active, showMax)
|
participant.isLocal, participant.active, showMax)
|
||||||
if (participant.videoMuted)
|
if (participant.videoMuted)
|
||||||
participantOverlays[p].setAvatar(true, participant.avatar, participant.uri, participant.isLocal, participant.isContact)
|
participantOverlays[p].setAvatar(true, participant.uri, participant.isLocal)
|
||||||
else
|
else
|
||||||
participantOverlays[p].setAvatar(false)
|
participantOverlays[p].setAvatar(false)
|
||||||
currentUris.push(participantOverlays[p].uri)
|
currentUris.push(participantOverlays[p].uri)
|
||||||
|
@ -120,7 +120,7 @@ Item {
|
||||||
hover.setMenu(infos[infoVariant].uri, infos[infoVariant].bestName,
|
hover.setMenu(infos[infoVariant].uri, infos[infoVariant].bestName,
|
||||||
infos[infoVariant].isLocal, infos[infoVariant].active, showMax)
|
infos[infoVariant].isLocal, infos[infoVariant].active, showMax)
|
||||||
if (infos[infoVariant].videoMuted)
|
if (infos[infoVariant].videoMuted)
|
||||||
hover.setAvatar(true, infos[infoVariant].avatar, infos[infoVariant].uri, infos[infoVariant].isLocal, infos[infoVariant].isContact)
|
hover.setAvatar(true, infos[infoVariant].uri, infos[infoVariant].isLocal)
|
||||||
else
|
else
|
||||||
hover.setAvatar(false)
|
hover.setAvatar(false)
|
||||||
participantOverlays.push(hover)
|
participantOverlays.push(hover)
|
||||||
|
|
|
@ -376,7 +376,8 @@ Utils::contactPhoto(LRCInstance* instance,
|
||||||
photo = Utils::fallbackAvatar("ring:" + contactInfo.profileInfo.uri, avatarName);
|
photo = Utils::fallbackAvatar("ring:" + contactInfo.profileInfo.uri, avatarName);
|
||||||
}
|
}
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
qDebug() << Q_FUNC_INFO << e.what();
|
qDebug() << e.what() << "; Using default avatar";
|
||||||
|
photo = fallbackAvatar("jami:" + contactUri, QString(), size);
|
||||||
}
|
}
|
||||||
return Utils::scaleAndFrame(photo, size);
|
return Utils::scaleAndFrame(photo, size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue