1
0
Fork 0
forked from blue/squawk

first thought about forms, discovering contact pep support

This commit is contained in:
Blue 2022-08-26 01:49:49 +03:00
parent c50cd1140e
commit 7b2b7ee5d5
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
11 changed files with 230 additions and 9 deletions

View file

@ -623,12 +623,13 @@ void Core::Account::onDiscoveryInfoReceived(const QXmppDiscoveryIq& info)
bool pepSupported = false;
for (const QXmppDiscoveryIq::Identity& identity : identities) {
QString type = identity.type();
qDebug() << " " << identity.category() << type;
if (type == "pep") {
QString category = identity.category();
qDebug() << " " << category << type;
if (type == "pep" && category == "pubsub") {
pepSupported = true;
}
}
rh->setPepSupport(pepSupported);
rh->setPepSupport(pepSupported ? Shared::Support::supported : Shared::Support::unsupported);
} else {
qDebug() << "Received info for account" << name << "about" << from;
QString node = info.queryNode();
@ -651,6 +652,22 @@ void Core::Account::onDiscoveryInfoReceived(const QXmppDiscoveryIq& info)
qDebug() << " " << feat;
}
emit infoDiscovered(from, node, identities, features);
} else {
Contact* cont = rh->getContact(from);
if (cont != nullptr) {
qDebug() << "Received info for account" << name << "about" << from;
QList<QXmppDiscoveryIq::Identity> identities = info.identities();
bool pepSupported = false;
for (const QXmppDiscoveryIq::Identity& identity : identities) {
QString type = identity.type();
QString category = identity.category();
qDebug() << " " << category << type;
if (type == "pep" && category == "pubsub") {
pepSupported = true;
}
}
cont->setPepSupport(pepSupported ? Shared::Support::supported : Shared::Support::unsupported);
}
}
}
}