5#ifndef QXMPPBLOCKINGMANAGER_H
6#define QXMPPBLOCKINGMANAGER_H
8#include "QXmppClientExtension.h"
16struct QXmppBlockingManagerPrivate;
21 struct NotBlocked { };
23 QVector<QString> blockingEntries;
24 QVector<QString> partiallyBlockingEntries;
26 struct PartiallyBlocked {
27 QVector<QString> partiallyBlockingEntries;
30 using BlockingState = std::variant<NotBlocked, PartiallyBlocked, Blocked>;
36 QVector<QString> entries()
const;
37 bool containsEntry(QStringView)
const;
41 QVector<QString> m_blocklist;
49 Q_PROPERTY(
bool subscribed READ isSubscribed NOTIFY subscribedChanged)
53 using Result = std::variant<QXmpp::Success, QXmppError>;
58 bool isSubscribed()
const;
67 Q_SIGNAL
void blocked(
const QVector<QString> &jids);
68 Q_SIGNAL
void unblocked(
const QVector<QString> &jids);
71 QStringList discoveryFeatures()
const override;
74 bool handleStanza(
const QDomElement &,
const std::optional<QXmppE2eeMetadata> &)
override;
80 std::unique_ptr<QXmppBlockingManagerPrivate> d;
Uses XEP-0191: Blocking Command to manage blocked accounts and services.
Definition: QXmppBlockingManager.h:45
Q_SIGNAL void unblocked(const QVector< QString > &jids)
QXmppTask< Result > unblock(QString jid)
Definition: QXmppBlockingManager.h:64
std::variant< QXmppBlocklist, QXmppError > BlocklistResult
Definition: QXmppBlockingManager.h:52
Q_SIGNAL void subscribedChanged()
Q_SIGNAL void blocked(const QVector< QString > &jids)
QXmppTask< Result > block(QString jid)
Definition: QXmppBlockingManager.h:62
std::variant< QXmpp::Success, QXmppError > Result
Definition: QXmppBlockingManager.h:53
List of blocked entries according to XEP-0191: Blocking Command with helper functions to check the bl...
Definition: QXmppBlockingManager.h:19
std::variant< NotBlocked, PartiallyBlocked, Blocked > BlockingState
Definition: QXmppBlockingManager.h:30
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:32
Main class for starting and managing connections to XMPP servers.
Definition: QXmppClient.h:62
Definition: QXmppTask.h:62