aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppSendStanzaParams.cpp
diff options
context:
space:
mode:
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);
+}