forked from blue/squawk
feat(OMEMO): qxmppfactories, refactoring
This commit is contained in:
parent
b22a4c8ca3
commit
6721b62629
8 changed files with 294 additions and 77 deletions
|
@ -6,7 +6,10 @@
|
|||
|
||||
#include <QXmppPubSubIq.h>
|
||||
|
||||
namespace QOmemo {
|
||||
#include <QDateTime>
|
||||
#include <QXmppMessage.h>
|
||||
|
||||
namespace QXmpp::Omemo {
|
||||
|
||||
class Device {
|
||||
public:
|
||||
|
@ -40,6 +43,8 @@ public:
|
|||
|
||||
class Bundle {
|
||||
public:
|
||||
[[nodiscard]] static QXmppPubSubIq fetchDeviceBundleIq(int deviceId);
|
||||
|
||||
[[nodiscard]] QXmppElement toXml() const;
|
||||
[[nodiscard]] QXmppIq toIq() const;
|
||||
void fromXml(const QXmppElement &element);
|
||||
|
@ -53,4 +58,37 @@ public:
|
|||
QList<PreKey> prekeys;
|
||||
};
|
||||
|
||||
class MessageKey {
|
||||
public:
|
||||
[[nodiscard]] QXmppElement toXml() const;
|
||||
|
||||
bool kex{};
|
||||
QString key{};
|
||||
};
|
||||
|
||||
class HeaderKeys {
|
||||
public:
|
||||
[[nodiscard]] QXmppElement toXml() const;
|
||||
|
||||
QString jid{};
|
||||
QList<MessageKey> keys{};
|
||||
};
|
||||
|
||||
class EncryptedMessage {
|
||||
public:
|
||||
[[nodiscard]] QXmppElement header() const;
|
||||
[[nodiscard]] QXmppElement content() const;
|
||||
[[nodiscard]] QXmppElement toXml() const;
|
||||
[[nodiscard]] QXmppElement payload() const;
|
||||
|
||||
int fromDeviceId{};
|
||||
|
||||
QList<HeaderKeys> keys{};
|
||||
QString from{};
|
||||
QString to{};
|
||||
QDateTime timestamp{};
|
||||
|
||||
QXmppMessage message{};
|
||||
};
|
||||
|
||||
} // namespace QOmemo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue