forked from blue/squawk
Client node now displays in all participants and presences, some additional checkups before querying empty clients, refactoring
This commit is contained in:
parent
76a9c5da0c
commit
21b40a9ccb
19 changed files with 407 additions and 317 deletions
|
@ -37,14 +37,10 @@ void Core::ClientCache::open() {
|
|||
void Core::ClientCache::close() {
|
||||
db.close();}
|
||||
|
||||
|
||||
bool Core::ClientCache::checkClient(const QString& node, const QString& ver, const QString& hash) {
|
||||
QString id = node + "/" + ver;
|
||||
bool Core::ClientCache::checkClient(const Shared::ClientId& p_id) {
|
||||
QString id = p_id.getId();
|
||||
if (requested.count(id) == 0 && !cache->checkRecord(id)) {
|
||||
Shared::ClientInfo& info = requested.insert(std::make_pair(id, Shared::ClientInfo())).first->second;
|
||||
info.id.node = node;
|
||||
info.id.verification = ver;
|
||||
info.id.hash = hash;
|
||||
requested.emplace(id, p_id);
|
||||
emit requestClientInfo(id);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <cache.h>
|
||||
|
||||
#include <shared/clientid.h>
|
||||
#include <shared/clientinfo.h>
|
||||
#include <shared/identity.h>
|
||||
|
||||
|
@ -43,7 +44,7 @@ signals:
|
|||
void requestClientInfo(const QString& id);
|
||||
|
||||
public slots:
|
||||
bool checkClient(const QString& node, const QString& ver, const QString& hash);
|
||||
bool checkClient(const Shared::ClientId& id);
|
||||
bool registerClientInfo(const QString& sourceFullJid, const QString& id, const std::set<Shared::Identity>& identities, const std::set<QString>& features);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue