From ceb62dd9d0d86bc8327ace116930962cf7fad1e9 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Mon, 9 May 2022 21:45:49 +0200 Subject: Implement XEP-0384: OMEMO Encryption v0.8 This implements XEP-0384 in version v0.8 with a manager and storage classes to be user-implemented for persistant storage. The license of the code is LGPL-2.1-or-later as usual. However since libomemo-c (libsignal-protocol-c) is GPL-3.0, the built binary is always licensed under GPL-3.0. Having our code LGPL licensed will make it avoids relicensing in the future in case we port it to an LGPL compatible omemo library. Closes #133. Co-authored-by: Linus Jahn --- src/base/QXmppMessage.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/base/QXmppMessage.h') diff --git a/src/base/QXmppMessage.h b/src/base/QXmppMessage.h index e9d442c1..ba6917c4 100644 --- a/src/base/QXmppMessage.h +++ b/src/base/QXmppMessage.h @@ -18,7 +18,9 @@ class QXmppMessagePrivate; class QXmppBitsOfBinaryDataList; class QXmppMixInvitation; +#ifdef BUILD_OMEMO class QXmppOmemoElement; +#endif class QXmppTrustMessageElement; /// @@ -232,10 +234,6 @@ public: QString spoilerHint() const; void setSpoilerHint(const QString &); - // XEP-0384: OMEMO Encryption - std::optional omemoElement() const; - void setOmemoElement(const std::optional &omemoElement); - // XEP-0407: Mediated Information eXchange (MIX): Miscellaneous Capabilities std::optional mixInvitation() const; void setMixInvitation(const std::optional &mixInvitation); @@ -249,6 +247,12 @@ public: void setTrustMessageElement(const std::optional &trustMessageElement); /// \cond +#ifdef BUILD_OMEMO + // XEP-0384: OMEMO Encryption + std::optional omemoElement() const; + void setOmemoElement(const std::optional &omemoElement); +#endif + void parse(const QDomElement &element) override final; virtual void parse(const QDomElement &element, QXmpp::SceMode); void toXml(QXmlStreamWriter *writer) const override final; -- cgit v1.2.3