forked from blue/squawk
first ever received and cached client data!
This commit is contained in:
parent
037dabbe06
commit
c50cd1140e
11 changed files with 297 additions and 60 deletions
|
@ -320,25 +320,27 @@ void Core::Squawk::onAccountAddPresence(const QString& jid, const QString& name,
|
|||
Account* acc = static_cast<Account*>(sender());
|
||||
emit addPresence(acc->getName(), jid, name, data);
|
||||
|
||||
QString node = data["capabilityNode"].toString();
|
||||
QString ver = data["capabilityVer"].toString();
|
||||
QString hash = data["capabilityHash"].toString();
|
||||
if (!clientCache.checkClient(node, ver, hash)) {
|
||||
acc->discoverInfo(jid + "/" + name, node + "/" + ver);
|
||||
//it's equal if a MUC sends its status with presence of the same jid (ex: muc@srv.im/muc@srv.im), it's not a client, so, no need to request
|
||||
if (jid != name) {
|
||||
QString node = data["capabilityNode"].toString();
|
||||
QString ver = data["capabilityVer"].toString();
|
||||
QString hash = data["capabilityHash"].toString();
|
||||
if (!clientCache.checkClient(node, ver, hash)) {
|
||||
acc->discoverInfo(jid + "/" + name, node + "/" + ver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Core::Squawk::onAccountInfoDiscovered(
|
||||
const QString& address,
|
||||
const QString& node,
|
||||
const std::list<Shared::Identity>& identities,
|
||||
const std::set<Shared::Identity>& identities,
|
||||
const std::set<QString>& features)
|
||||
{
|
||||
Account* acc = static_cast<Account*>(sender());
|
||||
|
||||
if (identities.size() != 1 || clientCache.registerClientInfo(address, node, identities.back(), features)) {
|
||||
if (!clientCache.registerClientInfo(address, node, identities, features)) {
|
||||
qDebug() << "Account" << acc->getName() << "received an ill-formed client discovery response from" << address << "about" << node;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue