From a42c11570b9bba3465fb79dc936de6cb3c7c48cb Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Thu, 7 Apr 2022 18:10:42 +0200 Subject: PubSubManager: Add requestFeatures() --- src/client/QXmppPubSubManager.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/client/QXmppPubSubManager.h') 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 @@ -25,6 +25,15 @@ class QXMPP_EXPORT QXmppPubSubManager : public QXmppClientExtension Q_OBJECT 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 /// @@ -32,6 +41,13 @@ public: Current ///< Item of a singleton node }; + /// + /// Used to indicate a service type mismatch. + /// + struct InvalidServiceType + { + }; + template struct Items { @@ -40,6 +56,7 @@ public: }; using Result = std::variant; + using FeaturesResult = std::variant, InvalidServiceType, QXmppStanza::Error>; using NodesResult = std::variant, QXmppStanza::Error>; using InstantNodeResult = std::variant; template @@ -58,6 +75,7 @@ public: ~QXmppPubSubManager(); // Generic PubSub (the PubSub service is the given entity) + QFuture requestFeatures(const QString &serviceJid, ServiceType serviceType = PubSubOrPep); QFuture fetchNodes(const QString &jid); QFuture createNode(const QString &jid, const QString &nodeName); QFuture createNode(const QString &jid, const QString &nodeName, const QXmppPubSubNodeConfig &config); -- cgit v1.2.3