forked from blue/squawk
first thought about forms, discovering contact pep support
This commit is contained in:
parent
c50cd1140e
commit
7b2b7ee5d5
11 changed files with 230 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue