aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2021-12-19 17:46:51 +0100
committerGitHub <noreply@github.com>2021-12-19 17:46:51 +0100
commit3012300f5f8b93e5120a8b1520841b6c934d58fd (patch)
tree0bb068c666ee7d4d14dfcb740e12b63d8d375523 /src/base
parent4ef85abe637cc5735f12e053e0faf4dd8e159564 (diff)
downloadqxmpp-3012300f5f8b93e5120a8b1520841b6c934d58fd.tar.gz
XEP-0380: Add new encryptions (#384)
Updates to version 0.4.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppConstants.cpp1
-rw-r--r--src/base/QXmppConstants_p.h1
-rw-r--r--src/base/QXmppMessage.cpp8
-rw-r--r--src/base/QXmppMessage.h12
4 files changed, 15 insertions, 7 deletions
diff --git a/src/base/QXmppConstants.cpp b/src/base/QXmppConstants.cpp
index 0f06a3da..b9fec104 100644
--- a/src/base/QXmppConstants.cpp
+++ b/src/base/QXmppConstants.cpp
@@ -175,6 +175,7 @@ const char* ns_eme = "urn:xmpp:eme:0";
const char* ns_spoiler = "urn:xmpp:spoiler:0";
// XEP-0384: OMEMO Encryption
const char* ns_omemo = "eu.siacs.conversations.axolotl";
+const char* ns_omemo_1 = "urn:xmpp:omemo:1";
const char* ns_omemo_2 = "urn:xmpp:omemo:2";
// XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
const char* ns_mix_pam = "urn:xmpp:mix:pam:1";
diff --git a/src/base/QXmppConstants_p.h b/src/base/QXmppConstants_p.h
index 47dbdd87..b0d402c8 100644
--- a/src/base/QXmppConstants_p.h
+++ b/src/base/QXmppConstants_p.h
@@ -187,6 +187,7 @@ extern const char* ns_eme;
extern const char* ns_spoiler;
// XEP-0384: OMEMO Encryption
extern const char* ns_omemo;
+extern const char* ns_omemo_1;
extern const char* ns_omemo_2;
// XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
extern const char* ns_mix_pam;
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp
index c5a30a46..927cf9b8 100644
--- a/src/base/QXmppMessage.cpp
+++ b/src/base/QXmppMessage.cpp
@@ -70,7 +70,9 @@ static const QStringList ENCRYPTION_NAMESPACES = {
ns_otr,
ns_legacy_openpgp,
ns_ox,
- ns_omemo
+ ns_omemo,
+ ns_omemo_1,
+ ns_omemo_2
};
static const QStringList HINT_TYPES = {
@@ -86,7 +88,9 @@ static const QStringList ENCRYPTION_NAMES = {
QStringLiteral("OTR"),
QStringLiteral("Legacy OpenPGP"),
QStringLiteral("OpenPGP for XMPP (OX)"),
- QStringLiteral("OMEMO")
+ QStringLiteral("OMEMO"),
+ QStringLiteral("OMEMO 1"),
+ QStringLiteral("OMEMO 2")
};
static bool checkElement(const QDomElement &element, const QString &tagName, const QString &xmlns)
diff --git a/src/base/QXmppMessage.h b/src/base/QXmppMessage.h
index ee1ecdca..24036ea6 100644
--- a/src/base/QXmppMessage.h
+++ b/src/base/QXmppMessage.h
@@ -99,17 +99,19 @@ public:
///
/// 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.
+ /// algorithm. See \xep{0380, Explicit Message Encryption} for details.
///
/// \since QXmpp 1.1
///
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
+ 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}
+ OMEMO1, ///< \xep{0384, OMEMO Encryption} since version 0.4
+ OMEMO2 ///< \xep{0384, OMEMO Encryption} since version 0.8
};
QXmppMessage(const QString &from = QString(), const QString &to = QString(),