1
0
Fork 0
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:
Blue 2023-03-14 22:49:58 +03:00
parent 76a9c5da0c
commit 21b40a9ccb
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
19 changed files with 407 additions and 317 deletions

View file

@ -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;
}

View file

@ -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: