1
0
Fork 0
forked from blue/squawk

first ever received and cached client data!

This commit is contained in:
Blue 2022-08-25 01:41:06 +03:00
parent 037dabbe06
commit c50cd1140e
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
11 changed files with 297 additions and 60 deletions

View file

@ -634,16 +634,16 @@ void Core::Account::onDiscoveryInfoReceived(const QXmppDiscoveryIq& info)
QString node = info.queryNode();
if (!node.isEmpty()) {
QStringList feats = info.features();
std::list<Shared::Identity> identities;
std::set<Shared::Identity> identities;
std::set<QString> features(feats.begin(), feats.end());
QList<QXmppDiscoveryIq::Identity> idents = info.identities();
for (const QXmppDiscoveryIq::Identity& ident : idents) {
identities.emplace_back();
Shared::Identity& identity = identities.back();
Shared::Identity identity;
identity.category = ident.category();
identity.language = ident.language();
identity.name = ident.name();
identity.type = ident.type();
identities.insert(identity);
qDebug() << " " << identity.name << identity.category << identity.type;
}
@ -655,6 +655,16 @@ void Core::Account::onDiscoveryInfoReceived(const QXmppDiscoveryIq& info)
}
}
void Core::Account::discoverInfo(const QString& address, const QString& node) {
if (state == Shared::ConnectionState::connected) {
dm->requestInfo(address, node);
} else {
qDebug() << "An attempt to send a discover info by account" << name <<
"sending request to" << address << "about node" << node <<
"but the account is not in the connected state, skipping";
}
}
void Core::Account::handleDisconnection()
{
cm->setCarbonsEnabled(false);