aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppSendStanzaParams.cpp
blob: ca628f1474729eedb56de42cefd80e848d03dbc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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::setEncryptionJids(QVector<QString> encryptionJids)
{
    d->encryptionJids = std::move(encryptionJids);
}