diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-04-04 12:51:32 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-05-18 21:47:11 +0200 |
| commit | 9073ea57506e4081881355a508a29ea5325b9e8b (patch) | |
| tree | eb62c5ec7bdec36e80581883db8472ab86050d4f /src/client/QXmppClientExtension.cpp | |
| parent | 402bb6f33610f7aba9d8295d8c08be2e64324a5d (diff) | |
| download | qxmpp-9073ea57506e4081881355a508a29ea5325b9e8b.tar.gz | |
ClientExtension: Add handleStanza() overload with e2ee metdata
For handling end-to-end-encrypted stanzas it is important to know
whether and which encryption was used. This is especially important for
replying to IQ stanzas (with the correct encryption).
Currently the e2eeMetadata parameter is unused (always nullopt). This is
going to change in the following commits.
Diffstat (limited to 'src/client/QXmppClientExtension.cpp')
| -rw-r--r-- | src/client/QXmppClientExtension.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/client/QXmppClientExtension.cpp b/src/client/QXmppClientExtension.cpp index 5e16d52a..c5e00c21 100644 --- a/src/client/QXmppClientExtension.cpp +++ b/src/client/QXmppClientExtension.cpp @@ -45,6 +45,43 @@ QList<QXmppDiscoveryIq::Identity> QXmppClientExtension::discoveryIdentities() co return QList<QXmppDiscoveryIq::Identity>(); } +/// +/// \brief You need to implement this method to process incoming XMPP +/// stanzas. +/// +/// You should return true if the stanza was handled and no further +/// processing should occur, or false to let other extensions process +/// the stanza. +/// +/// \deprecated This is deprecated since QXmpp 1.5. Please use +/// QXmppClientExtension::handleStanza(const QDomElement &stanza, +/// const std::optional<QXmppE2eeMetadata> &e2eeMetadata). +/// Currently both methods are called by the client, so only implement one! +/// +bool QXmppClientExtension::handleStanza(const QDomElement &) +{ + return false; +} + +/// +/// \brief You need to implement this method to process incoming XMPP +/// stanzas. +/// +/// \param stanza The DOM element to be handled. +/// \param e2eeMetadata If the element has been decrypted this contains metdata +/// about the encryption. +/// +/// \return You should return true if the stanza was handled and no further +/// processing should occur, or false to let other extensions process the +/// stanza. +/// +/// \since QXmpp 1.5 +/// +bool QXmppClientExtension::handleStanza(const QDomElement &, const std::optional<QXmppE2eeMetadata> &) +{ + return false; +} + /// Returns the client which loaded this extension. /// |
