1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-07-19 23:15:25 +02:00

misc: fix missing account avatar

Change-Id: I69acb78e60e04f74382561e130185a1aca8064d6
This commit is contained in:
Sébastien Blin 2024-02-08 14:55:07 -05:00
parent 8305c0a082
commit e054fc9592

View file

@ -309,13 +309,15 @@ getAccountAvatar(const QString& accountId)
QString filePath;
filePath = accountLocalPath + "profile.vcf";
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly))
if (!file.open(QIODevice::ReadOnly)) {
return {};
}
const auto vCard = lrc::vCard::utils::toHashMap(file.readAll());
const auto photo = (vCard.find(vCard::Property::PHOTO_PNG) == vCard.end())
? vCard[vCard::Property::PHOTO_JPEG]
: vCard[vCard::Property::PHOTO_PNG];
return photo;
for (const auto& key : vCard.keys()) {
if (key.contains("PHOTO"))
return vCard[key];
}
return {};
}
static QPair<QString, QString>