aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppSendStanzaParams.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2022-05-22 18:14:54 +0200
committerLinus Jahn <lnj@kaidan.im>2022-05-22 19:35:56 +0200
commit4a146238b0ddaed6e59f92c0f75536695a9f6b6c (patch)
treee212e79f6fa07eeb42dffa790aca4199f640620c /src/client/QXmppSendStanzaParams.cpp
parent9e96ab61349e313bf91035b3872a89510bfeee2f (diff)
downloadqxmpp-4a146238b0ddaed6e59f92c0f75536695a9f6b6c.tar.gz
Add SendStanzaParams for passing additional parameters
For now only contains a list of JIDs the stanza should be encrypted for.
Diffstat (limited to 'src/client/QXmppSendStanzaParams.cpp')
-rw-r--r--src/client/QXmppSendStanzaParams.cpp54
1 files changed, 54 insertions, 0 deletions
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 <lnj@kaidan.im>
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
+#include "QXmppSendStanzaParams.h"
+
+#include <QVector>
+
+///
+/// \class QXmppSendStanzaParams
+///
+/// Contains additional parameters for sending stanzas.
+///
+/// \since QXmpp 1.5
+///
+
+class QXmppSendStanzaParamsPrivate : public QSharedData
+{
+public:
+ QVector<QString> 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<QString> 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<QString> encryptionJids)
+{
+ d->encryptionJids = std::move(encryptionJids);
+}