aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppPubSubManager.h
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2022-04-07 18:10:42 +0200
committerLinus Jahn <lnj@kaidan.im>2022-04-09 22:27:12 +0200
commita42c11570b9bba3465fb79dc936de6cb3c7c48cb (patch)
tree0d5a417e9fa1972fd89797c074bbbef3113fd51f /src/client/QXmppPubSubManager.h
parentd306ed08aa9d681a0b51ebbf2ec2a00b70b61018 (diff)
downloadqxmpp-a42c11570b9bba3465fb79dc936de6cb3c7c48cb.tar.gz
PubSubManager: Add requestFeatures()
Diffstat (limited to 'src/client/QXmppPubSubManager.h')
-rw-r--r--src/client/QXmppPubSubManager.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client/QXmppPubSubManager.h b/src/client/QXmppPubSubManager.h
index 8e02f801..8c7a014b 100644
--- a/src/client/QXmppPubSubManager.h
+++ b/src/client/QXmppPubSubManager.h
@@ -26,12 +26,28 @@ class QXMPP_EXPORT QXmppPubSubManager : public QXmppClientExtension
public:
///
+ /// Type of PubSub service
+ ///
+ enum ServiceType {
+ PubSubOrPep, ///< PubSub service or PEP service
+ PubSub, ///< PubSub service only
+ Pep ///< PEP service only
+ };
+
+ ///
/// Pre-defined ID of a PubSub item
///
enum StandardItemId {
Current ///< Item of a singleton node
};
+ ///
+ /// Used to indicate a service type mismatch.
+ ///
+ struct InvalidServiceType
+ {
+ };
+
template<typename T>
struct Items
{
@@ -40,6 +56,7 @@ public:
};
using Result = std::variant<QXmpp::Success, QXmppStanza::Error>;
+ using FeaturesResult = std::variant<QVector<QString>, InvalidServiceType, QXmppStanza::Error>;
using NodesResult = std::variant<QVector<QString>, QXmppStanza::Error>;
using InstantNodeResult = std::variant<QString, QXmppStanza::Error>;
template<typename T>
@@ -58,6 +75,7 @@ public:
~QXmppPubSubManager();
// Generic PubSub (the PubSub service is the given entity)
+ QFuture<FeaturesResult> requestFeatures(const QString &serviceJid, ServiceType serviceType = PubSubOrPep);
QFuture<NodesResult> fetchNodes(const QString &jid);
QFuture<Result> createNode(const QString &jid, const QString &nodeName);
QFuture<Result> createNode(const QString &jid, const QString &nodeName, const QXmppPubSubNodeConfig &config);