aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2022-03-26 12:26:07 +0100
committerLinus Jahn <lnj@kaidan.im>2022-04-06 15:02:47 +0200
commita3e110d6a219f2dc3bfd6d8fc238f5d022f30aea (patch)
tree5978ba3b14760645446fff2af6bd6c7785157ef2 /src/base
parent66b718973a9d32cecdabf1c54799e605fca00fbb (diff)
downloadqxmpp-a3e110d6a219f2dc3bfd6d8fc238f5d022f30aea.tar.gz
Message: Replace QXmppMessage::EncryptionMethod with QXmpp::Encryption
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppMessage.cpp10
-rw-r--r--src/base/QXmppMessage.h35
2 files changed, 20 insertions, 25 deletions
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp
index e493cf17..dfb60240 100644
--- a/src/base/QXmppMessage.cpp
+++ b/src/base/QXmppMessage.cpp
@@ -972,15 +972,15 @@ void QXmppMessage::setMixUserNick(const QString &mixUserNick)
///
/// \since QXmpp 1.1
///
-QXmppMessage::EncryptionMethod QXmppMessage::encryptionMethod() const
+QXmpp::Encryption QXmppMessage::encryptionMethod() const
{
if (d->encryptionMethod.isEmpty())
- return QXmppMessage::NoEncryption;
+ return QXmpp::NoEncryption;
int index = ENCRYPTION_NAMESPACES.indexOf(d->encryptionMethod);
if (index < 0)
- return QXmppMessage::UnknownEncryption;
- return static_cast<QXmppMessage::EncryptionMethod>(index);
+ return QXmpp::UnknownEncryption;
+ return static_cast<QXmpp::Encryption>(index);
}
///
@@ -989,7 +989,7 @@ QXmppMessage::EncryptionMethod QXmppMessage::encryptionMethod() const
///
/// \since QXmpp 1.1
///
-void QXmppMessage::setEncryptionMethod(QXmppMessage::EncryptionMethod method)
+void QXmppMessage::setEncryptionMethod(QXmpp::Encryption method)
{
d->encryptionMethod = ENCRYPTION_NAMESPACES.at(int(method));
}
diff --git a/src/base/QXmppMessage.h b/src/base/QXmppMessage.h
index b7db3eab..1f0c81b5 100644
--- a/src/base/QXmppMessage.h
+++ b/src/base/QXmppMessage.h
@@ -29,6 +29,19 @@ class QXmppTrustMessageElement;
class QXMPP_EXPORT QXmppMessage : public QXmppStanza
{
public:
+/// \cond
+#if QXMPP_DEPRECATED_SINCE(1, 5)
+ using EncryptionMethod = QXmpp::Encryption;
+
+ static const EncryptionMethod NoEncryption = EncryptionMethod::NoEncryption;
+ static const EncryptionMethod UnknownEncryption = EncryptionMethod::UnknownEncryption;
+ static const EncryptionMethod OTR = EncryptionMethod::Otr;
+ static const EncryptionMethod LegacyOpenPGP = EncryptionMethod::LegacyOpenPgp;
+ static const EncryptionMethod OX = EncryptionMethod::Ox;
+ static const EncryptionMethod OMEMO = EncryptionMethod::Omemo;
+#endif
+/// \endcond
+
/// This enum describes a message type.
enum Type {
Error = 0,
@@ -77,24 +90,6 @@ public:
Store = 1 << 3 ///< Do store the message
};
- ///
- /// This enum describes different end-to-end encryption methods. These can
- /// be used to mark a message explicitly as encrypted with a specific
- /// 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}
- 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(),
const QString &body = QString(), const QString &thread = QString());
@@ -220,8 +215,8 @@ public:
void setMixUserNick(const QString &);
// XEP-0380: Explicit Message Encryption
- EncryptionMethod encryptionMethod() const;
- void setEncryptionMethod(EncryptionMethod);
+ QXmpp::Encryption encryptionMethod() const;
+ void setEncryptionMethod(QXmpp::Encryption);
QString encryptionMethodNs() const;
void setEncryptionMethodNs(const QString &);