Now avatars are properly autogenerated, reduced vCard spam

This commit is contained in:
Blue 2024-01-31 20:22:49 -03:00
parent 93c5be412e
commit 0be2648849
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
9 changed files with 76 additions and 92 deletions

View file

@ -73,18 +73,17 @@ void Core::Contact::handlePresence(const QXmppPresence& pres) {
case QXmppPresence::VCardUpdateNoPhoto: { //there is no photo, need to drop if any
Archive::AvatarInfo info;
bool hasAvatar = readAvatarInfo(info);
if (!hasAvatar || !info.autogenerated) {
if (!hasAvatar || !info.autogenerated)
setAutoGeneratedAvatar();
}
}
break;
case QXmppPresence::VCardUpdateValidPhoto:{ //there is a photo, need to load
Archive::AvatarInfo info;
bool hasAvatar = readAvatarInfo(info);
if (hasAvatar) {
if (info.autogenerated || info.hash != pres.photoHash()) {
if (info.autogenerated || info.hash != pres.photoHash())
emit requestVCard(jid);
}
} else {
emit requestVCard(jid);
}