From e7394afc6730b16673f4173fcbc55d54a810a80b Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 28 Apr 2019 22:11:25 +0200 Subject: Implement XEP-0380: Explicit Message Encryption This adds parsing and serialization for XEP-0380: Explicit Message Encryption in version 0.3.0. https://xmpp.org/extensions/xep-0380.html --- src/base/QXmppMessage.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/base/QXmppMessage.h') diff --git a/src/base/QXmppMessage.h b/src/base/QXmppMessage.h index 330c70fe..69e2d451 100644 --- a/src/base/QXmppMessage.h +++ b/src/base/QXmppMessage.h @@ -66,6 +66,18 @@ public: Acknowledged }; + /// This enum describes different end-to-end encryption methods. These can + /// be used to mark a message explicitly as encrypted with a specific + /// algothim. See XEP-0380: Explicit Message Encryption for details. + enum EncryptionMethod { + NoEncryption, ///< No encryption + UnknownEncryption, ///< Unknown encryption + OTR, ///< XEP-0364: Current Off-the-Record Messaging Usage + LegacyOpenPGP, ///< XEP-0027: Current Jabber OpenPGP Usage + OX, ///< XEP-0373: OpenPGP for XMPP + OMEMO ///< XEP-0384: OMEMO Encryption + }; + QXmppMessage(const QString& from = QString(), const QString& to = QString(), const QString& body = QString(), const QString& thread = QString()); @@ -151,6 +163,15 @@ public: QString mixUserNick() const; void setMixUserNick(const QString&); + // XEP-0380: Explicit Message Encryption + EncryptionMethod encryptionMethod() const; + void setEncryptionMethod(EncryptionMethod); + QString encryptionMethodNs() const; + void setEncryptionMethodNs(const QString&); + + QString encryptionName() const; + void setEncryptionName(const QString&); + // XEP-0382: Spoiler messages bool isSpoiler() const; void setIsSpoiler(bool); -- cgit v1.2.3