mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 06:45:45 +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) {
|
||||
bestName = tr("me");
|
||||
data["isLocal"] = true;
|
||||
if (participant["videoMuted"] == "true")
|
||||
data["avatar"] = accInfo.profileInfo.avatar;
|
||||
} else {
|
||||
try {
|
||||
auto& contact = lrcInstance_->getCurrentAccountInfo().contactModel->getContact(
|
||||
participant["uri"]);
|
||||
bestName = lrcInstance_->getCurrentAccountInfo().contactModel->bestNameForContact(
|
||||
participant["uri"]);
|
||||
if (participant["videoMuted"] == "true")
|
||||
data["avatar"] = contact.profileInfo.avatar;
|
||||
data["isContact"] = true;
|
||||
} catch (...) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,20 +52,18 @@ Item {
|
|||
|
||||
z: 1
|
||||
|
||||
function setAvatar(show, base64, uri, local, isContact) {
|
||||
function setAvatar(show, uri, isLocal) {
|
||||
if (!show)
|
||||
contactImage.visible = false
|
||||
avatar.visible = false
|
||||
else {
|
||||
if (local) {
|
||||
contactImage.imageId = LRCInstance.currentAccountId
|
||||
} else if (isContact) {
|
||||
contactImage.avatarMode = AvatarImage.AvatarMode.FromContactUri
|
||||
contactImage.updateImage(uri)
|
||||
if (isLocal) {
|
||||
avatar.mode = Avatar.Mode.Account
|
||||
avatar.imageId = LRCInstance.currentAccountId
|
||||
} else {
|
||||
contactImage.avatarMode = AvatarImage.AvatarMode.FromTemporaryName
|
||||
contactImage.updateImage(uri)
|
||||
avatar.mode = Avatar.Mode.Contact
|
||||
avatar.imageId = uri
|
||||
}
|
||||
contactImage.visible = true
|
||||
avatar.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,8 +167,8 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
ConversationAvatar {
|
||||
id: contactImage
|
||||
Avatar {
|
||||
id: avatar
|
||||
|
||||
anchors.centerIn: parent
|
||||
height: Math.min(parent.width / 2, parent.height / 2)
|
||||
|
|
|
@ -77,7 +77,7 @@ Item {
|
|||
participantOverlays[p].setMenu(participant.uri, participant.bestName,
|
||||
participant.isLocal, participant.active, showMax)
|
||||
if (participant.videoMuted)
|
||||
participantOverlays[p].setAvatar(true, participant.avatar, participant.uri, participant.isLocal, participant.isContact)
|
||||
participantOverlays[p].setAvatar(true, participant.uri, participant.isLocal)
|
||||
else
|
||||
participantOverlays[p].setAvatar(false)
|
||||
currentUris.push(participantOverlays[p].uri)
|
||||
|
@ -120,7 +120,7 @@ Item {
|
|||
hover.setMenu(infos[infoVariant].uri, infos[infoVariant].bestName,
|
||||
infos[infoVariant].isLocal, infos[infoVariant].active, showMax)
|
||||
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
|
||||
hover.setAvatar(false)
|
||||
participantOverlays.push(hover)
|
||||
|
|
|
@ -376,7 +376,8 @@ Utils::contactPhoto(LRCInstance* instance,
|
|||
photo = Utils::fallbackAvatar("ring:" + contactInfo.profileInfo.uri, avatarName);
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue