extracted clientId from clientInfo to use it in the presence information later
This commit is contained in:
parent
8ec0af3205
commit
76a9c5da0c
6 changed files with 137 additions and 38 deletions
|
@ -32,20 +32,16 @@ const std::map<QString, QCryptographicHash::Algorithm> Shared::ClientInfo::hashe
|
|||
Shared::ClientInfo::ClientInfo():
|
||||
identities(),
|
||||
extensions(),
|
||||
node(),
|
||||
verification(),
|
||||
hash(),
|
||||
id(),
|
||||
specificPresence() {}
|
||||
|
||||
QString Shared::ClientInfo::getId() const {
|
||||
return node + "/" + verification;
|
||||
return id.getId();
|
||||
}
|
||||
|
||||
|
||||
QDataStream & Shared::ClientInfo::operator >> (QDataStream& stream) const {
|
||||
stream << node;
|
||||
stream << verification;
|
||||
stream << hash;
|
||||
stream << id;
|
||||
stream << (quint8)identities.size();
|
||||
for (const Shared::Identity& identity : identities) {
|
||||
stream << identity;
|
||||
|
@ -59,9 +55,7 @@ QDataStream & Shared::ClientInfo::operator >> (QDataStream& stream) const {
|
|||
}
|
||||
|
||||
QDataStream & Shared::ClientInfo::operator << (QDataStream& stream) {
|
||||
stream >> node;
|
||||
stream >> verification;
|
||||
stream >> hash;
|
||||
stream >> id;
|
||||
|
||||
quint8 size;
|
||||
stream >> size;
|
||||
|
@ -82,7 +76,7 @@ QDataStream & Shared::ClientInfo::operator << (QDataStream& stream) {
|
|||
}
|
||||
|
||||
bool Shared::ClientInfo::valid() const {
|
||||
std::map<QString, QCryptographicHash::Algorithm>::const_iterator itr = hashes.find(hash);
|
||||
std::map<QString, QCryptographicHash::Algorithm>::const_iterator itr = hashes.find(id.hash);
|
||||
if (itr == hashes.end()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -98,7 +92,7 @@ bool Shared::ClientInfo::valid() const {
|
|||
|
||||
QString result = calc.result().toBase64();
|
||||
|
||||
return result == verification;
|
||||
return result == id.verification;
|
||||
}
|
||||
|
||||
QDataStream& operator << (QDataStream& stream, const Shared::ClientInfo& info) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue