aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2021-08-28 14:39:02 +0200
committerLinus Jahn <lnj@kaidan.im>2021-09-16 18:43:00 +0200
commitbb8780ecdbfe7eddb8280e696871e71b744d0bff (patch)
tree585989b6e6a58c3f2af42c0681d87e93e2c592e7 /src/base
parentb147ea5f4004cbd9aa2e7ae3936734a869bf3a44 (diff)
downloadqxmpp-bb8780ecdbfe7eddb8280e696871e71b744d0bff.tar.gz
Add QXmppAtmManager
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppConstants.cpp2
-rw-r--r--src/base/QXmppConstants_p.h2
-rw-r--r--src/base/QXmppMessage.cpp39
-rw-r--r--src/base/QXmppMessage.h3
4 files changed, 46 insertions, 0 deletions
diff --git a/src/base/QXmppConstants.cpp b/src/base/QXmppConstants.cpp
index db896683..c6ae77de 100644
--- a/src/base/QXmppConstants.cpp
+++ b/src/base/QXmppConstants.cpp
@@ -186,3 +186,5 @@ const char* ns_mix_misc = "urn:xmpp:mix:misc:0";
const char* ns_fallback_indication = "urn:xmpp:fallback:0";
// XEP-0434: Trust Messages (TM)
const char* ns_tm = "urn:xmpp:tm:0";
+// XEP-0450: Automatic Trust Management (ATM)
+const char* ns_atm = "urn:xmpp:atm:1";
diff --git a/src/base/QXmppConstants_p.h b/src/base/QXmppConstants_p.h
index 1d55ad03..2b9e70d6 100644
--- a/src/base/QXmppConstants_p.h
+++ b/src/base/QXmppConstants_p.h
@@ -198,5 +198,7 @@ extern const char* ns_mix_misc;
extern const char* ns_fallback_indication;
// XEP-0434: Trust Messages (TM)
extern const char* ns_tm;
+// XEP-0450: Automatic Trust Management (ATM)
+extern const char* ns_atm;
#endif // QXMPPCONSTANTS_H
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp
index f975ae3c..e97731ae 100644
--- a/src/base/QXmppMessage.cpp
+++ b/src/base/QXmppMessage.cpp
@@ -108,6 +108,7 @@ public:
QString thread;
QString parentThread;
QXmppMessage::Type type;
+ QString senderKey;
// XEP-0066: Out of Band Data
QString outOfBandUrl;
@@ -325,6 +326,44 @@ void QXmppMessage::setParentThread(const QString &parent)
}
///
+/// Returns the ID of this message's sender's public long-term key.
+///
+/// The key ID is not part of a transmitted message and thus not de- /
+/// serialized.
+/// Instead, the key ID is set by an encryption protocol such as
+/// \xep{0384, OMEMO Encryption} when it decrypts this message.
+/// It can be used by trust management protocols such as
+/// \xep{0450, Automatic Trust Management (ATM)}.
+///
+/// \return the ID of the sender's key
+///
+/// \since QXmpp 1.5
+///
+QString QXmppMessage::senderKey() const
+{
+ return d->senderKey;
+}
+
+///
+/// Sets the ID of this message's sender's public long-term key.
+///
+/// The key ID is not part of a transmitted message and thus not de- /
+/// serialized.
+/// Instead, the key ID is set by an encryption protocol such as
+/// \xep{0384, OMEMO Encryption} when it decrypts this message.
+/// It can be used by trust management protocols such as
+/// \xep{0450, Automatic Trust Management (ATM)}.
+///
+/// \param keyId ID of the sender's key
+///
+/// \since QXmpp 1.5
+///
+void QXmppMessage::setSenderKey(const QString &keyId)
+{
+ d->senderKey = keyId;
+}
+
+///
/// Returns a possibly attached URL from \xep{0066}: Out of Band Data
///
/// \since QXmpp 1.0
diff --git a/src/base/QXmppMessage.h b/src/base/QXmppMessage.h
index 6688d3b6..b2cb972d 100644
--- a/src/base/QXmppMessage.h
+++ b/src/base/QXmppMessage.h
@@ -136,6 +136,9 @@ public:
QXmppMessage::Type type() const;
void setType(QXmppMessage::Type);
+ QString senderKey() const;
+ void setSenderKey(const QString &keyId);
+
// XEP-0066: Out of Band Data
QString outOfBandUrl() const;
void setOutOfBandUrl(const QString &);