diff --git a/main/main.cpp b/main/main.cpp index 3e9add3..9147ef0 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -20,6 +20,7 @@ #include "shared/messageinfo.h" #include "shared/pathcheck.h" #include "shared/identity.h" +#include "shared/info.h" #include "main/application.h" #include "core/signalcatcher.h" #include "core/squawk.h" @@ -51,6 +52,7 @@ int main(int argc, char *argv[]) qRegisterMetaType("Shared::ConnectionState"); qRegisterMetaType("Shared::Availability"); qRegisterMetaType("Shared::KeyInfo"); + qRegisterMetaType("Shared::Info"); #ifdef WITH_OMEMO qRegisterMetaType("QXmppOmemoStorage::OwnDevice"); qRegisterMetaTypeStreamOperators("QXmppOmemoStorage::OwnDevice"); diff --git a/shared/CMakeLists.txt b/shared/CMakeLists.txt index a227163..9080fb6 100644 --- a/shared/CMakeLists.txt +++ b/shared/CMakeLists.txt @@ -28,4 +28,6 @@ target_sources(squawk PRIVATE field.cpp keyinfo.cpp keyinfo.h + info.cpp + info.h ) diff --git a/shared/info.cpp b/shared/info.cpp new file mode 100644 index 0000000..bda2b9f --- /dev/null +++ b/shared/info.cpp @@ -0,0 +1,32 @@ +// Squawk messenger. +// Copyright (C) 2019 Yury Gubich +// +// 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 . + +#include "info.h" + +Shared::Info::Info(): + vcard(), + activeKeys(), + inactiveKeys() +{} + +Shared::Info::Info(const Shared::Info& other): + vcard(other.vcard), + activeKeys(other.activeKeys), + inactiveKeys(other.inactiveKeys) +{} + +Shared::Info::~Info() +{} diff --git a/shared/info.h b/shared/info.h new file mode 100644 index 0000000..1692991 --- /dev/null +++ b/shared/info.h @@ -0,0 +1,46 @@ +// Squawk messenger. +// Copyright (C) 2019 Yury Gubich +// +// 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 . + +#ifndef SHARED_INFO_H +#define SHARED_INFO_H + +#include "vcard.h" +#include "keyinfo.h" + +#include + +namespace Shared { + +/** + * This class should contain all nessesary data to display + * roster element info (contact, or out of roster contact, or MUC, or MIX in the future) + * + * under development yet + */ +class Info { +public: + Info(); + Info(const Info& other); + ~Info(); + + VCard vcard; + std::list activeKeys; + std::list inactiveKeys; +}; + +} + +#endif // SHARED_INFO_H