Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.1969
Browse files Browse the repository at this point in the history
It is based on:
* psi: 260a7cb8
* plugins: 7a65467
* psimedia: 478567e
* resources: e32ef4b
  • Loading branch information
tehnick committed Jun 13, 2024
1 parent 2f4e1c1 commit afde2a2
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 9 deletions.
9 changes: 9 additions & 0 deletions psi.doap
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,15 @@
</xmpp:SupportedXep>
</implements>

<!-- XEP-0292: vCard4 Over XMPP -->
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource='https://xmpp.org/extensions/xep-0292.html'/>
<xmpp:status>complete</xmpp:status>
<xmpp:version>0.12.0</xmpp:version>
</xmpp:SupportedXep>
</implements>

<!-- XEP-0300: Use of Cryptographic Hash Functions in XMPP -->
<implements>
<xmpp:SupportedXep>
Expand Down
4 changes: 2 additions & 2 deletions src/avatars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,13 +1086,13 @@ void AvatarFactory::publish_success(const QString &n, const PubSubItem &item)
meta_el.appendChild(info_el);
account()->pepManager()->publish(PEP_AVATAR_METADATA_NS, PubSubItem(d->selfAvatarHash_, meta_el));
if (account()->client()->serverInfoManager()->accountFeatures().hasAvatarConversion()) {
VCardFactory::instance()->setPhoto(account()->jid(), d->selfAvatarData_, {});
VCardFactory::instance()->setPhoto(account()->jid(), d->selfAvatarData_, VCardFactory::Silent);
}
d->selfAvatarData_.clear(); // we don't need it anymore
} else if (n == PEP_AVATAR_METADATA_NS) {
bool removed = item.payload().firstChildElement("metadata").firstChildElement("info").isNull();
if (account()->client()->serverInfoManager()->accountFeatures().hasAvatarConversion() && removed) {
VCardFactory::instance()->deletePhoto(account()->jid(), {});
VCardFactory::instance()->deletePhoto(account()->jid(), VCardFactory::Silent);
}
}
}
Expand Down
27 changes: 26 additions & 1 deletion src/psiaccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2390,6 +2390,7 @@ void PsiAccount::serverFeaturesChanged()
if (d->client->serverInfoManager()->serverFeatures().hasVCard() && !d->vcardChecked) {
// Get the vcard
const auto vcard = VCardFactory::instance()->vcard(d->jid);
#if 0 // feels not needed with pubsub vcards. commented out on 2024-06-13. TODO remove options?
if (PsiOptions::instance()->getOption("options.vcard.query-own-vcard-on-login").toBool() || vcard.isEmpty()
|| (vcard.nickName().isEmpty() && vcard.fullName().isEmpty())) {
auto req = VCardFactory::instance()->getVCard(this, d->jid);
Expand Down Expand Up @@ -2423,7 +2424,9 @@ void PsiAccount::serverFeaturesChanged()
changeVCard();
}
});
} else {
} else
#endif
{
d->nickFromVCard = true;
// if we get here, one of these fields is non-empty
if (!vcard.nickName().isEmpty()) {
Expand Down Expand Up @@ -3866,6 +3869,28 @@ void PsiAccount::itemPublished(const Jid &j, const QString &n, const PubSubItem
u->setGeoLocation(geoloc);
cpUpdate(*u);
}
} else if (n == QLatin1String("urn:ietf:params:xml:ns:vcard-4.0")) {
// we are interested only in our own at the moment
if (j.compare(d->jid, false)) {
VCard4::VCard vcard(item.payload());
QString nick = d->jid.node();
bool changeOwn;
if (vcard) {
if (!vcard.nickName().isEmpty()) {
d->nickFromVCard = true;
nick = vcard.nickName();
} else if (!vcard.fullName().isEmpty()) {
d->nickFromVCard = true;
nick = vcard.fullName();
}
if (!vcard.photo().isEmpty()) {
d->vcardPhotoUpdate(vcard.photo());
}
setNick(nick);

changeOwn = vcard.isEmpty();
}
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/psicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,8 @@ QStringList PsiCon::xmppFatures() const
<< "http://jabber.org/protocol/activity+notify"
<< "http://jabber.org/protocol/tune+notify"
<< "http://jabber.org/protocol/geoloc+notify"
<< "urn:xmpp:avatar:metadata+notify")
<< "urn:xmpp:avatar:metadata+notify"
<< "urn:xmpp:contacts+notify")
<< OptFeatureMap("options.messages.send-composing-events",
QStringList() << "http://jabber.org/protocol/chatstates")
<< OptFeatureMap("options.ui.notifications.send-receipts", QStringList() << "urn:xmpp:receipts");
Expand Down
10 changes: 7 additions & 3 deletions src/vcardfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ void VCardFactory::saveVCard(const Jid &j, const VCard4::VCard &vcard, Flags fla
*nickIt = vcard;
}

emit vcardChanged(j, flags);
if (!(flags & Silent)) {
emit vcardChanged(j, flags);
}
return;
}

Expand Down Expand Up @@ -170,8 +172,10 @@ void VCardFactory::saveVCard(const Jid &j, const VCard4::VCard &vcard, Flags fla
file.remove();
}

Jid jid = j;
emit vcardChanged(jid, flags);
Jid jid = j;
if (!(flags & Silent)) {
emit vcardChanged(jid, flags);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/vcardfactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class VCardFactory : public QObject {
Q_OBJECT

public:
enum Flag { MucRoom = 0x1, MucUser = 0x2, Cache = 0x4, ForceVCardTemp = 0x8 };
enum Flag { MucRoom = 0x1, MucUser = 0x2, Cache = 0x4, ForceVCardTemp = 0x8, Silent = 0x10 };
Q_DECLARE_FLAGS(Flags, Flag);

static VCardFactory *instance();
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1968 (2024-06-13, 5d129299)
1.5.1969 (2024-06-13, 260a7cb8)

0 comments on commit afde2a2

Please sign in to comment.