QXmpp: QXmppPubSubManager Class Reference

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppPubSubManager Class Reference
Managers

The QXmppPubSubManager aims to provide publish-subscribe functionality as specified in XEP-0060: Publish-Subscribe (PubSub). More...

Inheritance diagram for QXmppPubSubManager:

## Classes
struct | InvalidServiceType

## Public Types
enum | ServiceType { PubSubOrPep , PubSub , Pep }
enum | StandardItemId { Current }
using | Result = std::variant<QXmpp::Success, QXmppError>
using | FeaturesResult = std::variant<QVector<QString>, InvalidServiceType, QXmppError>
using | NodesResult = std::variant<QVector<QString>, QXmppError>
using | InstantNodeResult = std::variant<QString, QXmppError>
template<typename T>
using | ItemResult = std::variant<T, QXmppError>
template<typename T>
using | ItemsResult = std::variant<Items<T>, QXmppError>
using | ItemIdsResult = std::variant<QVector<QString>, QXmppError>
using | PublishItemResult = std::variant<QString, QXmppError>
using | PublishItemsResult = std::variant<QVector<QString>, QXmppError>
using | SubscriptionsResult = std::variant<QVector<QXmppPubSubSubscription>, QXmppError>
using | AffiliationsResult = std::variant<QVector<QXmppPubSubAffiliation>, QXmppError>
using | OptionsResult = std::variant<QXmppPubSubSubscribeOptions, QXmppError>
using | NodeConfigResult = std::variant<QXmppPubSubNodeConfig, QXmppError>

## Public Member Functions
| QXmppPubSubManager ()
| ~QXmppPubSubManager ()
QXmppTask< NodesResult > | requestNodes (const QString &jid)
auto | createNode (const QString &jid, const QString &nodeName) -> QXmppTask< Result >
auto | createNode (const QString &jid, const QString &nodeName, const QXmppPubSubNodeConfig &config) -> QXmppTask< Result >
auto | createInstantNode (const QString &jid) -> QXmppTask< InstantNodeResult >
auto | createInstantNode (const QString &jid, const QXmppPubSubNodeConfig &config) -> QXmppTask< InstantNodeResult >
auto | deleteNode (const QString &jid, const QString &nodeName) -> QXmppTask< Result >
QXmppTask< ItemIdsResult > | requestItemIds (const QString &serviceJid, const QString &nodeName)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemResult< T > > | requestItem (const QString &jid, const QString &nodeName, const QString &itemId)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemResult< T > > | requestItem (const QString &jid, const QString &nodeName, StandardItemId itemId)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemsResult< T > > | requestItems (const QString &jid, const QString &nodeName)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemsResult< T > > | requestItems (const QString &jid, const QString &nodeName, const QStringList &itemIds)
template<typename T>
QXmppTask< PublishItemResult > | publishItem (const QString &jid, const QString &nodeName, const T &item)
template<typename T>
QXmppTask< PublishItemResult > | publishItem (const QString &jid, const QString &nodeName, const T &item, const QXmppPubSubPublishOptions &publishOptions)
template<typename T>
QXmppTask< PublishItemsResult > | publishItems (const QString &jid, const QString &nodeName, const QVector< T > &items)
template<typename T>
QXmppTask< PublishItemsResult > | publishItems (const QString &jid, const QString &nodeName, const QVector< T > &items, const QXmppPubSubPublishOptions &publishOptions)
auto | retractItem (const QString &jid, const QString &nodeName, const QString &itemId, bool notify=false) -> QXmppTask< Result >
auto | retractItem (const QString &jid, const QString &nodeName, StandardItemId itemId, bool notify=false) -> QXmppTask< Result >
auto | purgeItems (const QString &jid, const QString &nodeName) -> QXmppTask< Result >
QXmppTask< SubscriptionsResult > | requestSubscriptions (const QString &jid)
QXmppTask< SubscriptionsResult > | requestSubscriptions (const QString &jid, const QString &nodeName)
QXmppTask< AffiliationsResult > | requestNodeAffiliations (const QString &jid, const QString &nodeName)
QXmppTask< AffiliationsResult > | requestAffiliations (const QString &jid)
QXmppTask< AffiliationsResult > | requestAffiliations (const QString &jid, const QString &nodeName)
QXmppTask< OptionsResult > | requestSubscribeOptions (const QString &service, const QString &nodeName)
QXmppTask< OptionsResult > | requestSubscribeOptions (const QString &service, const QString &nodeName, const QString &subscriberJid)
QXmppTask< Result > | setSubscribeOptions (const QString &service, const QString &nodeName, const QXmppPubSubSubscribeOptions &options)
QXmppTask< Result > | setSubscribeOptions (const QString &service, const QString &nodeName, const QXmppPubSubSubscribeOptions &options, const QString &subscriberJid)
QXmppTask< NodeConfigResult > | requestNodeConfiguration (const QString &service, const QString &nodeName)
QXmppTask< Result > | configureNode (const QString &service, const QString &nodeName, const QXmppPubSubNodeConfig &config)
QXmppTask< Result > | cancelNodeConfiguration (const QString &service, const QString &nodeName)
QXmppTask< Result > | subscribeToNode (const QString &serviceJid, const QString &nodeName, const QString &subscriberJid)
QXmppTask< Result > | unsubscribeFromNode (const QString &serviceJid, const QString &nodeName, const QString &subscriberJid)
QXmppTask< NodesResult > | requestOwnPepNodes ()
QXmppTask< Result > | createOwnPepNode (const QString &nodeName)
QXmppTask< Result > | createOwnPepNode (const QString &nodeName, const QXmppPubSubNodeConfig &config)
QXmppTask< Result > | deleteOwnPepNode (const QString &nodeName)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemResult< T > > | requestOwnPepItem (const QString &nodeName, const QString &itemId)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemResult< T > > | requestOwnPepItem (const QString &nodeName, StandardItemId itemId)
template<typename T = QXmppPubSubBaseItem>
QXmppTask< ItemsResult< T > > | requestOwnPepItems (const QString &nodeName)
QXmppTask< ItemIdsResult > | requestOwnPepItemIds (const QString &nodeName)
template<typename T>
QXmppTask< PublishItemResult > | publishOwnPepItem (const QString &nodeName, const T &item, const QXmppPubSubPublishOptions &publishOptions)
template<typename T>
QXmppTask< PublishItemResult > | publishOwnPepItem (const QString &nodeName, const T &item)
template<typename T>
QXmppTask< PublishItemsResult > | publishOwnPepItems (const QString &nodeName, const QVector< T > &items, const QXmppPubSubPublishOptions &publishOptions)
template<typename T>
QXmppTask< PublishItemsResult > | publishOwnPepItems (const QString &nodeName, const QVector< T > &items)
QXmppTask< Result > | retractOwnPepItem (const QString &nodeName, const QString &itemId, bool notify=false)
QXmppTask< Result > | retractOwnPepItem (const QString &nodeName, StandardItemId itemId, bool notify=false)
QXmppTask< Result > | purgeOwnPepItems (const QString &nodeName)
QXmppTask< NodeConfigResult > | requestOwnPepNodeConfiguration (const QString &nodeName)
QXmppTask< Result > | configureOwnPepNode (const QString &nodeName, const QXmppPubSubNodeConfig &config)
QXmppTask< Result > | cancelOwnPepNodeConfiguration (const QString &nodeName)
Public Member Functions inherited from QXmppClientExtension
| QXmppClientExtension ()
virtual QStringList | discoveryFeatures () const
virtual QList< QXmppDiscoIdentity > | discoveryIdentities () const
virtual bool | handleStanza (const QDomElement &stanza)
| You need to implement this method to process incoming XMPP stanzas.
virtual bool | handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
| You need to implement this method to process incoming XMPP stanzas.
Public Member Functions inherited from QXmppLoggable
| QXmppLoggable (QObject *parent=nullptr)
Q_SIGNAL void | setGauge (const QString &gauge, double value)
| Sets the given gauge to value.
Q_SIGNAL void | logMessage (QXmppLogger::MessageType type, const QString &msg)
| This signal is emitted to send logging messages.
Q_SIGNAL void | updateCounter (const QString &counter, qint64 amount=1)
| Updates the given counter by amount.

## Static Public Member Functions
static QString | standardItemIdToString (StandardItemId itemId)

## Friends
class | tst_QXmppPubSubManager
class | QXmppOmemoManagerPrivate

## Additional Inherited Members
Protected Member Functions inherited from QXmppClientExtension
QXmppClient * | client () const
virtual void | setClient (QXmppClient *client)
virtual void | onRegistered (QXmppClient *client)
virtual void | onUnregistered (QXmppClient *client)
void | injectIq (const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
bool | injectMessage (QXmppMessage &&message)
Protected Member Functions inherited from QXmppLoggable
void | debug (const QString &message)
| Logs a debugging message.
void | info (const QString &message)
| Logs an informational message.
void | warning (const QString &message)
| Logs a warning message.
void | logReceived (const QString &message)
| Logs a received packet.
void | logSent (const QString &message)
| Logs a sent packet.

## Detailed Description

The QXmppPubSubManager aims to provide publish-subscribe functionality as specified in XEP-0060: Publish-Subscribe (PubSub).

However, it currently only supports a few PubSub use cases but all of the XEP-0060: Personal Eventing Protocol (PEP) ones. PEP allows a standard XMPP user account to function as a virtual PubSub service.

To make use of this manager, you need to instantiate it and load it into the QXmppClient instance as follows:

QXmppPubSubManager *manager = new QXmppPubSubManager;
client->addExtension(manager);
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
QXmppPubSubManager::QXmppPubSubManager
QXmppPubSubManager()
Definition QXmppPubSubManager.cpp:195

Note
  To subscribe to PEP event notifications use the QXmppClientExtension::discoveryFeatures method of your client extension according to section 9.2 of XEP-0060. For example:
  QStringList YourExtension::discoveryFeatures() const
  {
  return { "http://jabber.org/protocol/tune+notify" };
  }

Todo
  - Item pagination: Requesting a continuation
  - Requesting most recent items (max_items=x): https://xmpp.org/extensions/xep-0060.html#subscriber-retrieve-requestrecent
  - subscribe()/unsubscribe():
    - return subscription on success
    - correctly handle configuration required (and other) cases

Since
  QXmpp 1.5

## Member Typedef Documentation

## ◆ AffiliationsResult

using QXmppPubSubManager::AffiliationsResult = std::variant<QVector<QXmppPubSubAffiliation>, QXmppError>

Contains the list of affiliations with the node(s) (QVector<QXmppPubSubAffiliation>) or the returned IQ error (QXmppStanza::Error).

## ◆ FeaturesResult

using QXmppPubSubManager::FeaturesResult = std::variant<QVector<QString>, InvalidServiceType, QXmppError>

Type containing service discovery features, InvalidServiceType if the service is not of the desired type or the returned IQ error (QXmppStanza::Error).

## ◆ InstantNodeResult

using QXmppPubSubManager::InstantNodeResult = std::variant<QString, QXmppError>

Contains the name of the new node (QString) or the returned IQ error (QXmppStanza::Error).

## ◆ ItemIdsResult

using QXmppPubSubManager::ItemIdsResult = std::variant<QVector<QString>, QXmppError>

Contains all item IDs that have been found (QVector<QString>) or the returned IQ error (QXmppStanza::Error).

## ◆ ItemResult

template<typename T>

using QXmppPubSubManager::ItemResult = std::variant<T, QXmppError>

Contains the item if it has been found (std::optional<T>) or the returned IQ error (QXmppStanza::Error).

## ◆ ItemsResult

template<typename T>

using QXmppPubSubManager::ItemsResult = std::variant<Items<T>, QXmppError>

Contains all items that have been found (QVector<T>) or the returned IQ error (QXmppStanza::Error).

## ◆ NodeConfigResult

using QXmppPubSubManager::NodeConfigResult = std::variant<QXmppPubSubNodeConfig, QXmppError>

Contains a node configuration (QXmppPubSubNodeConfig) or the returned IQ error (QXmppStanza::Error).

## ◆ NodesResult

using QXmppPubSubManager::NodesResult = std::variant<QVector<QString>, QXmppError>

Type containing a list of node names or the returned IQ error (QXmppStanza::Error).

## ◆ OptionsResult

using QXmppPubSubManager::OptionsResult = std::variant<QXmppPubSubSubscribeOptions, QXmppError>

Contains the current subscribe options (QXmppPubSubSubscribeOptions) or the returned IQ error (QXmppStanza::Error).

## ◆ PublishItemResult

using QXmppPubSubManager::PublishItemResult = std::variant<QString, QXmppError>

Contains the ID of the item, if no ID was set in the request (QString) or the returned IQ error (QXmppStanza::Error).

## ◆ PublishItemsResult

using QXmppPubSubManager::PublishItemsResult = std::variant<QVector<QString>, QXmppError>

Contains the IDs of the items, if no IDs were set in the request (QVector<QString>) or the returned IQ error (QXmppStanza::Error).

## ◆ Result

using QXmppPubSubManager::Result = std::variant<QXmpp::Success, QXmppError>

Result of a generic request without a return value. Contains Success in case everything went well. If the returned IQ contained an error a QXmppStanza::Error is reported.

## ◆ SubscriptionsResult

using QXmppPubSubManager::SubscriptionsResult = std::variant<QVector<QXmppPubSubSubscription>, QXmppError>

Contains a list of active subscriptions (QVector<QXmppPubSubSubscription>) or the returned IQ error (QXmppStanza::Error).

## Member Enumeration Documentation

## ◆ ServiceType

enum QXmppPubSubManager::ServiceType

Type of PubSub service

Enumerator
PubSubOrPep | PubSub service or PEP service.
PubSub | PubSub service only.
Pep | PEP service only.

## ◆ StandardItemId

enum QXmppPubSubManager::StandardItemId

Pre-defined ID of a PubSub item

Enumerator
Current | Item of a singleton node (i.e., the node's single item).

## Constructor & Destructor Documentation

## ◆ QXmppPubSubManager()

QXmppPubSubManager::QXmppPubSubManager | ( |  | ) |

Default constructor.

## ◆ ~QXmppPubSubManager()

QXmppPubSubManager::~QXmppPubSubManager | ( |  | ) |

Default destructor.

## Member Function Documentation

## ◆ cancelNodeConfiguration()

QXmppTask< QXmppPubSubManager::Result > QXmppPubSubManager::cancelNodeConfiguration | ( | const QString & | service,
|  | const QString & | nodeName )

Cancels the configuration process and uses the default or exisiting configuration.

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service

Returns

See also
  requestNodeConfiguration()

## ◆ cancelOwnPepNodeConfiguration()

QXmppTask< Result > QXmppPubSubManager::cancelOwnPepNodeConfiguration | ( | const QString & | nodeName | ) |
| inline

This is a convenience method equivalent to calling cancelNodeConfiguration() the current account's bare JID.

Parameters

  nodeName | Name of the pubsub node on the service

Returns

See also
  requestOwnPepNodeConfiguration()

## ◆ configureNode()

QXmppTask< QXmppPubSubManager::Result > QXmppPubSubManager::configureNode | ( | const QString & | service,
|  | const QString & | nodeName,
|  | const QXmppPubSubNodeConfig & | config )

Sets a node configuration.

Requires owner privileges. You can use requestNodeConfiguration() to receive a data form with all valid options and default values.

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service
  config |

Returns

See also
  requestNodeConfiguration()

## ◆ configureOwnPepNode()

QXmppTask< Result > QXmppPubSubManager::configureOwnPepNode | ( | const QString & | nodeName,
|  | const QXmppPubSubNodeConfig & | config )
| inline

Sets a node configuration.

This is a convenience method equivalent to calling configureNode() the current account's bare JID.

Parameters

  nodeName | Name of the pubsub node on the service
  config |

Returns

See also
  requestOwnPepNodeConfiguration()

## ◆ createInstantNode() [1/2]

auto QXmppPubSubManager::createInstantNode | ( | const QString & | jid | ) | -> QXmppTask< InstantNodeResult >

Creates an instant pubsub node with the default configuration.

The pubsub service automatically generates a random node name. On success it is returned via the QFuture.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service

Returns

## ◆ createInstantNode() [2/2]

auto QXmppPubSubManager::createInstantNode | ( | const QString & | jid,
|  | const QXmppPubSubNodeConfig & | config ) -> QXmppTask< InstantNodeResult >

Creates an instant pubsub node with a custom configuration.

The pubsub service automatically generates a random node name. On success it is returned via the QFuture.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  config | The configuration for the node

Returns

## ◆ createNode() [1/2]

auto QXmppPubSubManager::createNode | ( | const QString & | jid,
|  | const QString & | nodeName ) -> QXmppTask< Result >

Creates an empty pubsub node with the default configuration.

Calling this before QXmppPubSubManager::publishItems is usually not necessary when publishing to a node for the first time if the service suppports the auto-create feature (Section 7.1.4 of XEP-0060).

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to be created

Returns

## ◆ createNode() [2/2]

auto QXmppPubSubManager::createNode | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const QXmppPubSubNodeConfig & | config ) -> QXmppTask< Result >

Creates an empty pubsub node with a custom configuration.

Calling this before QXmppPubSubManager::publishItems is usually not necessary when publishing to a node for the first time if the service suppports the auto-create feature (Section 7.1.4 of XEP-0060).

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to be created
  config | The configuration for the node

Returns

## ◆ createOwnPepNode() [1/2]

QXmppTask< Result > QXmppPubSubManager::createOwnPepNode | ( | const QString & | nodeName | ) |
| inline

Creates an empty PEP node with the default configuration.

This is a convenience method equivalent to calling QXmppPubSubManager::createNode on the current account's bare JID.

Calling this before QXmppPubSubManager::publishOwnPepItems is usually not necessary when publishing to a node for the first time if the service suppports the auto-create feature (Section 7.1.4 of XEP-0060).

Parameters

  nodeName | the name of the PEP node to be created

Returns

## ◆ createOwnPepNode() [2/2]

QXmppTask< Result > QXmppPubSubManager::createOwnPepNode | ( | const QString & | nodeName,
|  | const QXmppPubSubNodeConfig & | config )
| inline

Creates an empty PEP node with a custom configuration.

This is a convenience method equivalent to calling QXmppPubSubManager::createNode on the current account's bare JID.

Calling this before QXmppPubSubManager::publishOwnPepItems is usually not necessary when publishing to a node for the first time if the service suppports the auto-create feature (Section 7.1.4 of XEP-0060).

Parameters

  nodeName | the name of the PEP node to be created
  config | The configuration for the node

Returns

## ◆ deleteNode()

auto QXmppPubSubManager::deleteNode | ( | const QString & | jid,
|  | const QString & | nodeName ) -> QXmppTask< Result >

Deletes a pubsub node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to delete along with all of its items

Returns

## ◆ deleteOwnPepNode()

QXmppTask< Result > QXmppPubSubManager::deleteOwnPepNode | ( | const QString & | nodeName | ) |
| inline

Deletes a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::deleteNode on the current account's bare JID.

Parameters

  nodeName | the name of the PEP node to delete along with all of its items

Returns

## ◆ publishItem() [1/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemResult > QXmppPubSubManager::publishItem | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const T & | item )

Publishs one item to a pubsub node.

This is a convenience method equivalent to calling QXmppPubSubManager::publishItem with no publish options.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to publish the item to
  item | the item to publish

Returns

## ◆ publishItem() [2/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemResult > QXmppPubSubManager::publishItem | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const T & | item,
|  | const QXmppPubSubPublishOptions & | publishOptions )

Publishs one item to a pubsub node.

This is a convenience method equivalent to calling QXmppPubSubManager::publishItem with no publish options.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to publish the item to
  item | the item to publish
  publishOptions | publish-options for the items

Returns

## ◆ publishItems() [1/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemsResult > QXmppPubSubManager::publishItems | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const QVector< T > & | items )

Publishs items to a pubsub node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to publish the items to
  items | the items to publish

Returns

## ◆ publishItems() [2/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemsResult > QXmppPubSubManager::publishItems | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const QVector< T > & | items,
|  | const QXmppPubSubPublishOptions & | publishOptions )

Publishs items to a pubsub node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to publish the items to
  items | the items to publish
  publishOptions | publish-options for the items

Returns

## ◆ publishOwnPepItem() [1/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemResult > QXmppPubSubManager::publishOwnPepItem | ( | const QString & | nodeName,
|  | const T & | item )

Publishs one item to a PEP node.

Parameters

  nodeName | the name of the PEP node to publish the item to
  item | the item to publish

Returns

## ◆ publishOwnPepItem() [2/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemResult > QXmppPubSubManager::publishOwnPepItem | ( | const QString & | nodeName,
|  | const T & | item,
|  | const QXmppPubSubPublishOptions & | publishOptions )

Publishs one item to a PEP node.

Parameters

  nodeName | the name of the PEP node to publish the item to
  item | the item to publish
  publishOptions | publish-options for fine tuning

Returns

## ◆ publishOwnPepItems() [1/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemsResult > QXmppPubSubManager::publishOwnPepItems | ( | const QString & | nodeName,
|  | const QVector< T > & | items )

Publishs items to a PEP node.

Parameters

  nodeName | the name of the PEP node to publish the items to
  items | the items to publish

Returns

## ◆ publishOwnPepItems() [2/2]

template<typename T>

QXmppTask< QXmppPubSubManager::PublishItemsResult > QXmppPubSubManager::publishOwnPepItems | ( | const QString & | nodeName,
|  | const QVector< T > & | items,
|  | const QXmppPubSubPublishOptions & | publishOptions )

Publishs items to a PEP node.

Parameters

  nodeName | the name of the PEP node to publish the items to
  items | the items to publish
  publishOptions | publish-options for fine tuning (optional). Pass an empty form to honor the default options of the PEP node

Returns

## ◆ purgeItems()

auto QXmppPubSubManager::purgeItems | ( | const QString & | jid,
|  | const QString & | nodeName ) -> QXmppTask< Result >

Purges all items from a node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the PEP node to delete along with all of its items

Returns

## ◆ purgeOwnPepItems()

QXmppTask< Result > QXmppPubSubManager::purgeOwnPepItems | ( | const QString & | nodeName | ) |
| inline

Purges all items from a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::purgeItems on the current account's bare JID.

Parameters

  nodeName | the name of the PEP node to delete along with all of its items

Returns

## ◆ requestAffiliations() [1/2]

QXmppTask< QXmppPubSubManager::AffiliationsResult > QXmppPubSubManager::requestAffiliations | ( | const QString & | jid | ) |

Requests the user's affiliations with all PubSub nodes on a PubSub service.

Parameters

  jid | JID of the pubsub service

Returns

## ◆ requestAffiliations() [2/2]

QXmppTask< QXmppPubSubManager::AffiliationsResult > QXmppPubSubManager::requestAffiliations | ( | const QString & | jid,
|  | const QString & | nodeName )

Requests the user's affiliations with a PubSub node.

Parameters

  jid | JID of the pubsub service
  nodeName | Name of the pubsub node on the service.

Returns

## ◆ requestItem() [1/2]

template<typename T>

QXmppTask< QXmppPubSubManager::ItemResult< T > > QXmppPubSubManager::requestItem | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const QString & | itemId )

Requests a specific item of an entity's node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service. For PEP this should be an account's bare JID
  nodeName | the name of the node to query
  itemId | the ID of the item to retrieve

Returns

## ◆ requestItem() [2/2]

template<typename T>

QXmppTask< QXmppPubSubManager::ItemResult< T > > QXmppPubSubManager::requestItem | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | StandardItemId | itemId )

Requests a specific item of an entity's node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service. For PEP this should be an account's bare JID
  nodeName | the name of the node to query
  itemId | the ID of the item to retrieve

Returns

## ◆ requestItemIds()

QXmppTask< QXmppPubSubManager::ItemIdsResult > QXmppPubSubManager::requestItemIds | ( | const QString & | serviceJid,
|  | const QString & | nodeName )

Requests the IDs of all items of a pubsub service node via service discovery.

This uses a XEP-0030: Service Discovery items request to get a list of items.

Parameters

  serviceJid | JID of the entity hosting the pubsub service
  nodeName | the name of the node whose items are requested

Returns

## ◆ requestItems() [1/2]

template<typename T>

QXmppTask< QXmppPubSubManager::ItemsResult< T > > QXmppPubSubManager::requestItems | ( | const QString & | jid,
|  | const QString & | nodeName )

Requests all items of an entity's node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service. For PEP this should be an account's bare JID
  nodeName | the name of the node to query

Returns

## ◆ requestItems() [2/2]

template<typename T>

QXmppTask< QXmppPubSubManager::ItemsResult< T > > QXmppPubSubManager::requestItems | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const QStringList & | itemIds )

Requests items of an entity's node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service. For PEP this should be an account's bare JID
  nodeName | the name of the node to query
  itemIds | the IDs of the items to retrieve. If empty, retrieves all items

Returns

## ◆ requestNodeAffiliations()

QXmppTask< QXmppPubSubManager::AffiliationsResult > QXmppPubSubManager::requestNodeAffiliations | ( | const QString & | jid,
|  | const QString & | nodeName )

Requests the affiliations of all users on a PubSub node.

This can be used to view and manage affiliations of other users with a node. Owner privileges are required.

Parameters

  jid | JID of the pubsub service
  nodeName | Name of the pubsub node on the service.

Returns

## ◆ requestNodeConfiguration()

QXmppTask< QXmppPubSubManager::NodeConfigResult > QXmppPubSubManager::requestNodeConfiguration | ( | const QString & | service,
|  | const QString & | nodeName )

Requests the node configuration and starts the configuration process.

Requires owner privileges. If the result is successful (a node config form has been returned) this starts the configuration process. The next step is to call configureNode() or cancelNodeConfiguration().

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service

Returns

See also
  configureNode()
  cancelNodeConfiguration()

## ◆ requestNodes()

QXmppTask< QXmppPubSubManager::NodesResult > QXmppPubSubManager::requestNodes | ( | const QString & | jid | ) |

Requests all listed nodes of a pubsub service via service discovery.

This uses a XEP-0030: Service Discovery items request to get a list of nodes.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service

## ◆ requestOwnPepItem() [1/2]

template<typename T = QXmppPubSubBaseItem>

QXmppTask< ItemResult< T > > QXmppPubSubManager::requestOwnPepItem | ( | const QString & | nodeName,
|  | const QString & | itemId )
| inline

Requests a specific item of a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::requestItem on the current account's bare JID.

Parameters

  nodeName | name of the PEP node whose item is requested
  itemId | ID of the requested item

## ◆ requestOwnPepItem() [2/2]

template<typename T = QXmppPubSubBaseItem>

QXmppTask< ItemResult< T > > QXmppPubSubManager::requestOwnPepItem | ( | const QString & | nodeName,
|  | StandardItemId | itemId )
| inline

Requests a specific item of a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::requestItem on the current account's bare JID.

Parameters

  nodeName | name of the PEP node whose item is requested
  itemId | ID of the requested item

## ◆ requestOwnPepItemIds()

QXmppTask< ItemIdsResult > QXmppPubSubManager::requestOwnPepItemIds | ( | const QString & | nodeName | ) |
| inline

Requests the IDs of all items of a pubsub service node via service discovery.

This is a convenience method equivalent to calling QXmppPubSubManager::requestItemIds on the current account's bare JID.

Parameters

  nodeName | name of the PEP node whose item IDs are requested

## ◆ requestOwnPepItems()

template<typename T = QXmppPubSubBaseItem>

QXmppTask< ItemsResult< T > > QXmppPubSubManager::requestOwnPepItems | ( | const QString & | nodeName | ) |
| inline

Requests all items of a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::requestItems on the current account's bare JID.

Parameters

  nodeName | name of the PEP node whose items are requested

## ◆ requestOwnPepNodeConfiguration()

QXmppTask< NodeConfigResult > QXmppPubSubManager::requestOwnPepNodeConfiguration | ( | const QString & | nodeName | ) |
| inline

Requests the node configuration and starts the configuration process.

This is a convenience method equivalent to calling requestNodeConfiguration() the current account's bare JID.

Parameters

  nodeName | Name of the pubsub node on the service

Returns

See also
  configureOwnPepNode()
  cancelOwnPepNodeConfiguration()

## ◆ requestOwnPepNodes()

QXmppTask< NodesResult > QXmppPubSubManager::requestOwnPepNodes | ( |  | ) |
| inline

Requests all listed nodes of the own PEP service via service discovery.

This is a convenience method equivalent to calling QXmppPubSubManager::fetchNodes on the current account's bare JID.

## ◆ requestSubscribeOptions() [1/2]

QXmppTask< QXmppPubSubManager::OptionsResult > QXmppPubSubManager::requestSubscribeOptions | ( | const QString & | service,
|  | const QString & | nodeName )

Requests the subscribe options form of the own subscription to a node.

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service.

Returns

## ◆ requestSubscribeOptions() [2/2]

QXmppTask< QXmppPubSubManager::OptionsResult > QXmppPubSubManager::requestSubscribeOptions | ( | const QString & | service,
|  | const QString & | nodeName,
|  | const QString & | subscriberJid )

Requests the subscribe options form of a user's subscription to a node.

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service
  subscriberJid | JID of the user to request the options for

Returns

## ◆ requestSubscriptions() [1/2]

QXmppTask< QXmppPubSubManager::SubscriptionsResult > QXmppPubSubManager::requestSubscriptions | ( | const QString & | jid | ) |

Requests all subscriptions with a PubSub service.

Parameters

  jid | JID of the pubsub service

Returns

## ◆ requestSubscriptions() [2/2]

QXmppTask< QXmppPubSubManager::SubscriptionsResult > QXmppPubSubManager::requestSubscriptions | ( | const QString & | jid,
|  | const QString & | nodeName )

Requests the subscription(s) with a specific PubSub node.

Parameters

  jid | JID of the pubsub service
  nodeName | Name of the node on the pubsub service

Returns

## ◆ retractItem() [1/2]

auto QXmppPubSubManager::retractItem | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | const QString & | itemId,
|  | bool | notify = false ) -> QXmppTask< Result >

Deletes an item from a pubsub node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to delete the item from
  itemId | the ID of the item to delete
  notify | Whether to generate retraction notifications for subscribers (since QXmpp 1.11, default: false)

## ◆ retractItem() [2/2]

auto QXmppPubSubManager::retractItem | ( | const QString & | jid,
|  | const QString & | nodeName,
|  | StandardItemId | itemId,
|  | bool | notify = false ) -> QXmppTask< Result >

Deletes an item from a pubsub node.

Parameters

  jid | Jabber ID of the entity hosting the pubsub service
  nodeName | the name of the node to delete the item from
  itemId | the ID of the item to delete
  notify | Whether to generate retraction notifications for subscribers (since QXmpp 1.11, default: false)

## ◆ retractOwnPepItem() [1/2]

QXmppTask< Result > QXmppPubSubManager::retractOwnPepItem | ( | const QString & | nodeName,
|  | const QString & | itemId,
|  | bool | notify = false )
| inline

Deletes an item from a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::retractItem on the current account's bare JID.

Parameters

  nodeName | the name of the PEP node to delete the item from
  itemId | the ID of the item to delete
  notify | Whether to generate retraction notifications for subscribers (since QXmpp 1.13, default: false)

## ◆ retractOwnPepItem() [2/2]

QXmppTask< Result > QXmppPubSubManager::retractOwnPepItem | ( | const QString & | nodeName,
|  | StandardItemId | itemId,
|  | bool | notify = false )
| inline

Deletes an item from a PEP node.

This is a convenience method equivalent to calling QXmppPubSubManager::retractItem on the current account's bare JID.

Parameters

  nodeName | the name of the PEP node to delete the item from
  itemId | the ID of the item to delete
  notify | Whether to generate retraction notifications for subscribers (since QXmpp 1.13, default: false)

## ◆ setSubscribeOptions() [1/2]

QXmppTask< QXmppPubSubManager::Result > QXmppPubSubManager::setSubscribeOptions | ( | const QString & | service,
|  | const QString & | nodeName,
|  | const QXmppPubSubSubscribeOptions & | options )

Sets the subscription options for our own account.

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service
  options | The new options to be set

Returns

## ◆ setSubscribeOptions() [2/2]

QXmppTask< QXmppPubSubManager::Result > QXmppPubSubManager::setSubscribeOptions | ( | const QString & | service,
|  | const QString & | nodeName,
|  | const QXmppPubSubSubscribeOptions & | options,
|  | const QString & | subscriberJid )

Sets the subscription options for another users's account.

Parameters

  service | JID of the pubsub service
  nodeName | Name of the pubsub node on the service
  options | The new options to be set
  subscriberJid | The JID of the user

Returns

## ◆ standardItemIdToString()

QString QXmppPubSubManager::standardItemIdToString | ( | StandardItemId | itemId | ) |
| static

Returns a standard item ID string.

Parameters

  itemId | standard item ID to be translated

Returns
  the item ID string or a default-constructed string if there is no corresponding one

## ◆ subscribeToNode()

QXmppTask< QXmppPubSubManager::Result > QXmppPubSubManager::subscribeToNode | ( | const QString & | serviceJid,
|  | const QString & | nodeName,
|  | const QString & | subscriberJid )

Subscribes to a node.

Parameters

  serviceJid | JID of the pubsub service
  nodeName | name of the pubsub node being subscribed
  subscriberJid | bare or full JID of the subscriber

## ◆ unsubscribeFromNode()

QXmppTask< QXmppPubSubManager::Result > QXmppPubSubManager::unsubscribeFromNode | ( | const QString & | serviceJid,
|  | const QString & | nodeName,
|  | const QString & | subscriberJid )

Unsubscribes from a node.

Parameters

  serviceJid | JID of the pubsub service
  nodeName | name of the pubsub node being subscribed
  subscriberJid | bare or full JID of the subscriber

The documentation for this class was generated from the following files:

- QXmppPubSubManager.h
- QXmppPubSubManager.cpp