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:
parent
8305c0a082
commit
e054fc9592
1 changed files with 7 additions and 5 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue