From 4a146238b0ddaed6e59f92c0f75536695a9f6b6c Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 22 May 2022 18:14:54 +0200 Subject: Add SendStanzaParams for passing additional parameters For now only contains a list of JIDs the stanza should be encrypted for. --- src/client/QXmppSendStanzaParams.cpp | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/client/QXmppSendStanzaParams.cpp (limited to 'src/client/QXmppSendStanzaParams.cpp') diff --git a/src/client/QXmppSendStanzaParams.cpp b/src/client/QXmppSendStanzaParams.cpp new file mode 100644 index 00000000..afbcdbc6 --- /dev/null +++ b/src/client/QXmppSendStanzaParams.cpp @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: 2022 Linus Jahn +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#include "QXmppSendStanzaParams.h" + +#include + +/// +/// \class QXmppSendStanzaParams +/// +/// Contains additional parameters for sending stanzas. +/// +/// \since QXmpp 1.5 +/// + +class QXmppSendStanzaParamsPrivate : public QSharedData +{ +public: + QVector encryptionJids; +}; + +QXmppSendStanzaParams::QXmppSendStanzaParams() + : d(new QXmppSendStanzaParamsPrivate) +{ +} + +/// Copy-constructor +QXmppSendStanzaParams::QXmppSendStanzaParams(const QXmppSendStanzaParams &other) = default; +QXmppSendStanzaParams::~QXmppSendStanzaParams() = default; +/// Assignment operator +QXmppSendStanzaParams &QXmppSendStanzaParams::operator=(const QXmppSendStanzaParams &) = default; + +/// +/// Returns the list of JIDs that the stanza should be encrypted for. +/// +/// If this is empty, the stanza should be encrypted for the recipient. +/// This option is useful for groupchats. +/// +QVector QXmppSendStanzaParams::encryptionJids() const +{ + return d->encryptionJids; +} + +/// +/// Sets the list of JIDs that the stanza should be encrypted for. +/// +/// If this is empty, the stanza should be encrypted for the recipient. +/// This option is useful for groupchats. +/// +void QXmppSendStanzaParams::sendEncryptionJids(QVector encryptionJids) +{ + d->encryptionJids = std::move(encryptionJids); +} -- cgit v1.2.3