Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.1937
Browse files Browse the repository at this point in the history
It is based on:
* psi: 43863b93
* plugins: 7a65467
* psimedia: 478567e
* resources: e32ef4b
  • Loading branch information
tehnick committed May 30, 2024
1 parent faee153 commit c019595
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
15 changes: 14 additions & 1 deletion src/avatars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class AvatarCache : public FileCache {
if (hash.size() < 20)
return; // doesn't look like sha1 hash. just ignore it
// try append user first. since data may be unexpected and we want to save some cpu cycles.
// qDebug() << "append user " << jidFull << AvatarCache::AvatarType;
result = appendUser(hash, AvatarCache::AvatarType, jidFull);
if (result == AvatarCache::NoData) {
QByteArray ba = QByteArray::fromBase64(item.payload().text().toLatin1());
Expand All @@ -180,8 +181,10 @@ class AvatarCache : public FileCache {
QByteArray hash;
if (!isCurrent) {
hash = QByteArray::fromHex(id);
if (hash.size() < 20)
if (hash.size() < 20) {
// qDebug() << "not sha1";
return; // doesn't look like sha1 hash. just ignore it
}
}

VCardFactory::instance()->getVCard(pa, jid, VCardFactory::InterestPhoto);
Expand All @@ -190,6 +193,7 @@ class AvatarCache : public FileCache {
&& item.payload().firstChildElement().isNull()) {
// user wants to stop publishing avatar
// previously we used "stop" element. now specs are changed
// qDebug() << "remove AvatarType from cache" << jidFull;
result = AvatarCache::instance()->removeIcon(AvatarCache::AvatarType, jidFull);
} else {
auto mimes = QImageReader::supportedMimeTypes();
Expand All @@ -216,6 +220,7 @@ class AvatarCache : public FileCache {
}
}

// qDebug() << "remove from iconset" << jidFull;
iconset_->removeIcon(QString(QLatin1String("avatars/%1")).arg(jidFull));
emit avatarChanged(jidFull);
}
Expand Down Expand Up @@ -267,6 +272,7 @@ class AvatarCache : public FileCache {
QString iconName = QString("avatars/%1").arg(bareJid);
auto iconp = iconset_->icon(iconName);
if (iconp) {
// qDebug() << "return icons" << iconName << "from iconset for jid" << bareJid;
return iconp->pixmap();
}

Expand All @@ -286,6 +292,7 @@ class AvatarCache : public FileCache {
}

if (img.isNull()) {
// qDebug() << "return from vcardfactory for jid " << _jid.full();
auto vcard = VCardFactory::instance()->vcard(_jid);
if (vcard.isNull() || vcard.photo().isNull()) {
return QPixmap();
Expand All @@ -310,6 +317,7 @@ class AvatarCache : public FileCache {
// Update iconset
PsiIcon icon;
icon.setImpix(pm);
// qDebug() << "setting icon to iconset " << iconName << "=" << pm;
iconset_->setIcon(iconName, icon);

return pm;
Expand Down Expand Up @@ -354,6 +362,7 @@ class AvatarCache : public FileCache {
// Update iconset
PsiIcon icon;
icon.setImpix(pm);
// qDebug() << "setting icon " << QString("avatars/%1").arg(fullJid) << "=" << pm;
iconset_->setIcon(QString("avatars/%1").arg(fullJid), icon); // FIXME do we ever release it?

return pm;
Expand Down Expand Up @@ -552,11 +561,15 @@ class AvatarCache : public FileCache {
ba = vcard.photo();
OpResult result;
if (ba.isEmpty()) {
// qDebug() << "removeIcon VCardType from cache for " << fullJid;
result = AvatarCache::instance()->removeIcon(AvatarCache::VCardType, fullJid);
} else {
// qDebug() << "setIcon VCardType to cache for " << fullJid;
result = AvatarCache::instance()->setIcon(AvatarCache::VCardType, fullJid, ba);
}
if (result == UserUpdateRequired) {
// qDebug() << "removing icon from iconset:" <<
// QString(QLatin1String("avatars/%1")).arg(fullJid);
iconset_->removeIcon(QString(QLatin1String("avatars/%1")).arg(fullJid));
emit avatarChanged(j);
}
Expand Down
10 changes: 5 additions & 5 deletions src/contactlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ void ContactListModel::Private::realAddContact(PsiContact *contact)
monitoredContacts.insert(contact, q->toModelIndex(item));
}

connect(contact, SIGNAL(destroyed(PsiContact *)), SLOT(removeContact(PsiContact *)));
connect(contact, SIGNAL(groupsChanged()), SLOT(contactGroupsChanged()));
connect(contact, SIGNAL(updated()), SLOT(contactUpdated()));
connect(contact, SIGNAL(alert()), SLOT(contactUpdated()));
connect(contact, SIGNAL(anim()), SLOT(contactUpdated()));
connect(contact, &PsiContact::destroyed, this, &Private::removeContact);
connect(contact, &PsiContact::groupsChanged, this, &Private::contactGroupsChanged);
connect(contact, &PsiContact::updated, this, &Private::contactUpdated);
connect(contact, &PsiContact::alert, this, &Private::contactUpdated);
connect(contact, &PsiContact::anim, this, &Private::contactUpdated);
}

void ContactListModel::Private::addContacts(const QList<PsiContact *> &contacts)
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1936 (2024-05-30, 1c961b00)
1.5.1937 (2024-05-30, 43863b93)

0 comments on commit c019595

Please sign in to comment.