Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.1936
Browse files Browse the repository at this point in the history
It is based on:
* psi: 1c961b00
* plugins: 7a65467
* psimedia: 478567e
* resources: e32ef4b
  • Loading branch information
tehnick committed May 29, 2024
1 parent d520d79 commit faee153
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 51 deletions.
55 changes: 29 additions & 26 deletions src/avatars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ class AvatarCache : public FileCache {
return; // doesn't look like sha1 hash. just ignore it
}

VCardFactory::instance()->getVCard(pa, jid, VCardFactory::InterestPhoto);

if (item.payload().tagName() == QLatin1String(PEP_AVATAR_METADATA_TN)
&& item.payload().firstChildElement().isNull()) {
// user wants to stop publishing avatar
Expand Down Expand Up @@ -532,32 +534,33 @@ class AvatarCache : public FileCache {
iconset_->addToFactory(); // the factory will own the iconset
updateJids();

connect(VCardFactory::instance(), &VCardFactory::vcardChanged, this, [this](const Jid &j, bool isMuc) {
QByteArray ba;
QString fullJid;
XMPP::VCard vcard;
if (isMuc) {
vcard = VCardFactory::instance()->mucVcard(j);
fullJid = j.full();
} else {
vcard = VCardFactory::instance()->vcard(j);
fullJid = j.bare();
}
if (!vcard) {
return; // wtf??
}
ba = vcard.photo();
OpResult result;
if (ba.isEmpty()) {
result = AvatarCache::instance()->removeIcon(AvatarCache::VCardType, fullJid);
} else {
result = AvatarCache::instance()->setIcon(AvatarCache::VCardType, fullJid, ba);
}
if (result == UserUpdateRequired) {
iconset_->removeIcon(QString(QLatin1String("avatars/%1")).arg(fullJid));
emit avatarChanged(j);
}
});
connect(VCardFactory::instance(), &VCardFactory::vcardChanged, this,
[this](const Jid &j, VCardFactory::Flags flags) {
QByteArray ba;
QString fullJid;
XMPP::VCard vcard;
if (flags & VCardFactory::MucUser) {
vcard = VCardFactory::instance()->mucVcard(j);
fullJid = j.full();
} else {
vcard = VCardFactory::instance()->vcard(j);
fullJid = j.bare();
}
if (!vcard) {
return; // wtf??
}
ba = vcard.photo();
OpResult result;
if (ba.isEmpty()) {
result = AvatarCache::instance()->removeIcon(AvatarCache::VCardType, fullJid);
} else {
result = AvatarCache::instance()->setIcon(AvatarCache::VCardType, fullJid, ba);
}
if (result == UserUpdateRequired) {
iconset_->removeIcon(QString(QLatin1String("avatars/%1")).arg(fullJid));
emit avatarChanged(j);
}
});
}

bool areIconsEmpty(const JidIcons &icons) const { return !icons.avatar && !icons.vcard && !icons.customAvatar; }
Expand Down
8 changes: 0 additions & 8 deletions src/infodlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,6 @@ InfoWidget::InfoWidget(int type, const Jid &j, const VCard &vcard, PsiAccount *p
updateNick();
}
});
if (!gcc) {
connect(d->pa->pepManager(), &PEPManager::itemPublished, this,
[this](const Jid &jid, const QString &n, const PubSubItem &item) {
if (this->jid().compare(jid, false)) {
doRefresh();
}
});
}
m_ui.te_status->setReadOnly(true);
m_ui.te_status->setAcceptRichText(true);
PsiRichText::install(m_ui.te_status->document());
Expand Down
4 changes: 2 additions & 2 deletions src/psiaccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ public slots:
acc.proxyID = "";
}

void vcardChanged(const Jid &j)
void vcardChanged(const Jid &j, VCardFactory::Flags)
{
// our own vcard?
if (j.compare(jid, false)) {
Expand Down Expand Up @@ -2329,7 +2329,7 @@ void PsiAccount::client_rosterRequestFinished(bool success, int, const QString &
// PsiOptions::instance()->load(d->client);

// we need to have up-to-date photoHash for initial presence
d->vcardChanged(jid());
d->vcardChanged(jid(), {});
setStatusDirect(d->loginStatus, d->loginWithPriority);

emit rosterRequestFinished();
Expand Down
18 changes: 7 additions & 11 deletions src/psicontact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ PsiContact::PsiContact(const UserListItem &u, PsiAccount *account, bool isSelf)
if (d->account_) {
connect(d->account_->avatarFactory(), &AvatarFactory::avatarChanged, this, &PsiContact::avatarChanged);
}
connect(VCardFactory::instance(), &VCardFactory::vcardChanged, this, &PsiContact::vcardChanged);
connect(VCardFactory::instance(), &VCardFactory::vcardChanged, this,
[this](const Jid &j, VCardFactory::Flags flags) {
if (!j.compare(jid(), flags & VCardFactory::MucUser))
return;

emit updated();
});
update(u);

// updateParent();
Expand Down Expand Up @@ -686,16 +692,6 @@ void PsiContact::avatarChanged(const Jid &j)
emit updated();
}

void PsiContact::rereadVCard() { vcardChanged(jid()); }

void PsiContact::vcardChanged(const Jid &j)
{
if (!j.compare(jid(), false))
return;

emit updated();
}

// bool PsiContact::compare(const ContactListItem* other) const
//{
// const ContactListGroup* group = dynamic_cast<const ContactListGroup*>(other);
Expand Down
3 changes: 0 additions & 3 deletions src/psicontact.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ class PsiContact : public QObject {
QIcon picture() const;
QIcon alertPicture() const;

void rereadVCard();

bool groupOperationPermitted(const QString &oldGroupName, const QString &newGroupName) const;
QStringList groups() const;
void setGroups(QStringList);
Expand Down Expand Up @@ -144,7 +142,6 @@ public slots:

private slots:
void avatarChanged(const Jid &);
void vcardChanged(const Jid &);

void blockContactConfirmation(const QString &id, bool confirmed);
void blockContactConfirmationHelper(bool block);
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1935 (2024-05-29, 3b0f31e5)
1.5.1936 (2024-05-30, 1c961b00)

0 comments on commit faee153

Please sign in to comment.