forked from blue/squawk
some new shared classes, little reorganization, preparation to cache client info
This commit is contained in:
parent
2ae75a4b91
commit
037dabbe06
20 changed files with 297 additions and 32 deletions
|
@ -20,4 +20,5 @@ target_sources(squawk PRIVATE
|
|||
pathcheck.h
|
||||
clientinfo.h
|
||||
clientinfo.cpp
|
||||
identity.h
|
||||
)
|
||||
|
|
|
@ -23,8 +23,14 @@ Shared::ClientInfo::ClientInfo():
|
|||
capabilitiesNode(),
|
||||
capabilitiesVerification(),
|
||||
capabilitiesHash(),
|
||||
specificPresence(),
|
||||
capabilitiesExtensions() {}
|
||||
|
||||
QString Shared::ClientInfo::getId() const {
|
||||
return capabilitiesNode + "/" + capabilitiesVerification;
|
||||
}
|
||||
|
||||
|
||||
QDataStream & Shared::ClientInfo::operator >> (QDataStream& stream) const {
|
||||
stream << name;
|
||||
stream << category;
|
||||
|
|
|
@ -29,6 +29,8 @@ class ClientInfo
|
|||
public:
|
||||
ClientInfo();
|
||||
|
||||
QString getId() const;
|
||||
|
||||
QDataStream& operator << (QDataStream& stream);
|
||||
QDataStream& operator >> (QDataStream& stream) const;
|
||||
|
||||
|
@ -39,6 +41,7 @@ public:
|
|||
QString capabilitiesNode;
|
||||
QString capabilitiesVerification;
|
||||
QString capabilitiesHash;
|
||||
QString specificPresence;
|
||||
std::set<QString> capabilitiesExtensions;
|
||||
};
|
||||
|
||||
|
|
35
shared/identity.h
Normal file
35
shared/identity.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Squawk messenger.
|
||||
* Copyright (C) 2019 Yury Gubich <blue@macaw.me>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SHARED_IDENTITY_H
|
||||
#define SHARED_IDENTITY_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace Shared {
|
||||
|
||||
struct Identity {
|
||||
QString category;
|
||||
QString language;
|
||||
QString name;
|
||||
QString type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //SHARED_IDENTITY_H
|
Loading…
Add table
Add a link
Reference in a new issue