QXmpp: QXmppDiscoveryManager Class Reference

QXmpp Version: 1.14.3

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

The QXmppDiscoveryManager class makes it possible to discover information about other entities as defined by XEP-0030: Service Discovery. More...

Inheritance diagram for QXmppDiscoveryManager:

## Public Types
enum class | CachePolicy { Strict , Relaxed }
| Policies for how cached service discovery information is used. More...
using | InfoResult = std::variant<QXmppDiscoveryIq, QXmppError>
using | ItemsResult = std::variant<QList<QXmppDiscoveryIq::Item>, QXmppError>

## Public Member Functions
QXmppTask< QXmpp::Result< QXmppDiscoInfo > > | info (const QString &jid, const QString &node={}, CachePolicy fetchPolicy=CachePolicy::Relaxed)
QXmppTask< QXmpp::Result< QList< QXmppDiscoItem > > > | items (const QString &jid, const QString &node={}, CachePolicy fetchPolicy=CachePolicy::Relaxed)
const QList< QXmppDiscoIdentity > & | identities () const
void | setIdentities (const QList< QXmppDiscoIdentity > &identities)
const QList< QXmppDataForm > & | infoForms () const
void | setInfoForms (const QList< QXmppDataForm > &dataForms)
QString | clientCapabilitiesNode () const
void | setClientCapabilitiesNode (const QString &)
QXmppDiscoInfo | buildClientInfo () const
Q_SIGNAL void | infoReceived (const QXmppDiscoveryIq &)
Q_SIGNAL void | itemsReceived (const QXmppDiscoveryIq &)
QXmppTask< InfoResult > | requestDiscoInfo (const QString &jid, const QString &node={})
QXmppTask< ItemsResult > | requestDiscoItems (const QString &jid, const QString &node={})
QT_WARNING_POP QXmppDiscoveryIq | capabilities ()
QString | clientCategory () const
void | setClientCategory (const QString &)
void | setClientName (const QString &)
QString | clientApplicationName () const
QString | clientType () const
void | setClientType (const QString &)
QXmppDataForm | clientInfoForm () const
void | setClientInfoForm (const QXmppDataForm &form)
QString | requestInfo (const QString &jid, const QString &node=QString())
QString | requestItems (const QString &jid, const QString &node=QString())
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.

## Protected Member Functions
void | onRegistered (QXmppClient *client)
void | onUnregistered (QXmppClient *client)
Protected Member Functions inherited from QXmppClientExtension
QXmppClient * | client () const
virtual void | setClient (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.

## Friends
class | QXmppDiscoveryManagerPrivate

## Detailed Description

The QXmppDiscoveryManager class makes it possible to discover information about other entities as defined by XEP-0030: Service Discovery.

Since QXmpp 1.12 info and items queries are cached per session by default.

## Member Typedef Documentation

## ◆ InfoResult

using QXmppDiscoveryManager::InfoResult = std::variant<QXmppDiscoveryIq, QXmppError>

Contains the discovery information result in the form of an QXmppDiscoveryIq or (in case the request did not succeed) a QXmppStanza::Error.

Since
  QXmpp 1.5

## ◆ ItemsResult

using QXmppDiscoveryManager::ItemsResult = std::variant<QList<QXmppDiscoveryIq::Item>, QXmppError>

Contains a list of service discovery items or (in case the request did not succeed) a QXmppStanza::Error.

Since
  QXmpp 1.5

## Member Enumeration Documentation

## ◆ CachePolicy

enum class QXmppDiscoveryManager::CachePolicy
| strong

Policies for how cached service discovery information is used.

Enumerator
Strict | Always ensure the data is up-to-date. Cached data may be used only if it is guaranteed to be current (e.g. via entity capabilities).
Relaxed | Cached data may be used even if it is not guaranteed to be current, within the configured limits.

## Member Function Documentation

## ◆ buildClientInfo()

QXmppDiscoInfo QXmppDiscoveryManager::buildClientInfo | ( |  | ) | const

Builds a full disco info element for this client.

Contains features and identities from all extensions and identities and data forms configured in this manager.

Since
  QXmpp 1.12

## ◆ capabilities()

QXmppDiscoveryIq QXmppDiscoveryManager::capabilities | ( |  | ) |

Returns the client's full capabilities.

Deprecated
  Use buildClientInfo()

## ◆ clientApplicationName()

QString QXmppDiscoveryManager::clientApplicationName | ( |  | ) | const

Returns the name of the local XMPP client.

By default this is "QXmpp x.y.z".

Deprecated
  Use identities()

## ◆ clientCapabilitiesNode()

QString QXmppDiscoveryManager::clientCapabilitiesNode | ( |  | ) | const

Returns the capabilities node of the local XMPP client.

By default this is "org.qxmpp.caps".

## ◆ clientCategory()

QString QXmppDiscoveryManager::clientCategory | ( |  | ) | const

Returns the category of the local XMPP client.

By default this is "client".

Deprecated
  Use identities()

## ◆ clientInfoForm()

QXmppDataForm QXmppDiscoveryManager::clientInfoForm | ( |  | ) | const

Returns the client's extended information form, as defined by XEP-0128: Service Discovery Extensions.

Deprecated
  Use infoForms()

## ◆ clientType()

QString QXmppDiscoveryManager::clientType | ( |  | ) | const

Returns the type of the local XMPP client.

With Qt builds for Android, Blackberry, iOS or Windows Phone this is set to "phone", otherwise it defaults to "pc".

Deprecated
  Use identities()

## ◆ identities()

const QList< QXmppDiscoIdentity > & QXmppDiscoveryManager::identities | ( |  | ) | const

Returns the base identities of this client.

The identities are added to the service discovery information other entities can request.

Note
  Additionally also all identities reported via QXmppClientExtension::discoveryIdentities() are added.
  The default identity is type=client, category=pc/phone (OS dependent) and name="{application name} {application version}".

Since
  QXmpp 1.12

## ◆ info()

QXmppTask< Result< QXmppDiscoInfo > > QXmppDiscoveryManager::info | ( | const QString & | jid,
|  | const QString & | node = {},
|  | CachePolicy | cachePolicy = CachePolicy::Relaxed )

Fetches discovery info from the specified XMPP entity.

Since
  QXmpp 1.12

## ◆ infoForms()

const QList< QXmppDataForm > & QXmppDiscoveryManager::infoForms | ( |  | ) | const

Returns the data forms for this client as defined in XEP-0128: Service Discovery Extensions.

The data forms are added to the service discovery information other entities can request.

Since
  QXmpp 1.12

## ◆ infoReceived()

Q_SIGNAL void QXmppDiscoveryManager::infoReceived | ( | const QXmppDiscoveryIq & |  | ) |

This signal is emitted when an information response is received.

Deprecated

## ◆ items()

QXmppTask< Result< QList< QXmppDiscoItem > > > QXmppDiscoveryManager::items | ( | const QString & | jid,
|  | const QString & | node = {},
|  | CachePolicy | cachePolicy = CachePolicy::Relaxed )

Fetches discovery items from the specified XMPP entity.

Since
  QXmpp 1.12

## ◆ itemsReceived()

Q_SIGNAL void QXmppDiscoveryManager::itemsReceived | ( | const QXmppDiscoveryIq & |  | ) |

This signal is emitted when an items response is received.

Deprecated

## ◆ onRegistered()

void QXmppDiscoveryManager::onRegistered | ( | QXmppClient * | client | ) |
| protectedvirtual

Called after the extension has been added to a QXmppClient.

Parameters

  client |

Reimplemented from QXmppClientExtension.

## ◆ onUnregistered()

void QXmppDiscoveryManager::onUnregistered | ( | QXmppClient * | client | ) |
| protectedvirtual

Called after the extension has been removed from a QXmppClient.

Parameters

  client |

Reimplemented from QXmppClientExtension.

## ◆ requestDiscoInfo()

QXmppTask< QXmppDiscoveryManager::InfoResult > QXmppDiscoveryManager::requestDiscoInfo | ( | const QString & | jid,
|  | const QString & | node = {} )

Requests information from the specified XMPP entity.

Parameters

  jid | The target entity's JID.
  node | The target node (optional).

Deprecated
  Use info()

Since
  QXmpp 1.5

## ◆ requestDiscoItems()

QXmppTask< QXmppDiscoveryManager::ItemsResult > QXmppDiscoveryManager::requestDiscoItems | ( | const QString & | jid,
|  | const QString & | node = {} )

Requests items from the specified XMPP entity.

Parameters

  jid | The target entity's JID.
  node | The target node (optional).

Deprecated
  Use items()

Since
  QXmpp 1.5

## ◆ requestInfo()

QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED QString QXmppDiscoveryManager::requestInfo | ( | const QString & | jid,
|  | const QString & | node = QString() )

Requests information from the specified XMPP entity.

Parameters

  jid | The target entity's JID.
  node | The target node (optional).

Deprecated
  Use info()

## ◆ requestItems()

QString QXmppDiscoveryManager::requestItems | ( | const QString & | jid,
|  | const QString & | node = QString() )

Requests items from the specified XMPP entity.

Parameters

  jid | The target entity's JID.
  node | The target node (optional).

Deprecated
  Use items()

## ◆ setClientCapabilitiesNode()

void QXmppDiscoveryManager::setClientCapabilitiesNode | ( | const QString & | node | ) |

Sets the capabilities node of the local XMPP client.

By default this is "org.qxmpp.caps".

## ◆ setClientCategory()

QT_WARNING_POP void QXmppDiscoveryManager::setClientCategory | ( | const QString & | category | ) |

Sets the category of the local XMPP client.

You can find a list of valid categories at: http://xmpp.org/registrar/disco-categories.html

Deprecated
  Use setIdentities(), this function will remove other identities if set.

## ◆ setClientInfoForm()

void QXmppDiscoveryManager::setClientInfoForm | ( | const QXmppDataForm & | form | ) |

Sets the client's extended information form, as defined by XEP-0128: Service Discovery Extensions.

Deprecated
  Use setInfoForms()

## ◆ setClientName()

void QXmppDiscoveryManager::setClientName | ( | const QString & | name | ) |

Sets the name of the local XMPP client.

Deprecated
  Use setIdentities(), this function will remove other identities if set.

## ◆ setClientType()

void QXmppDiscoveryManager::setClientType | ( | const QString & | type | ) |

Sets the type of the local XMPP client.

You can find a list of valid types at: http://xmpp.org/registrar/disco-categories.html

Deprecated
  Use setIdentities(), this function will remove other identities if set.

## ◆ setIdentities()

void QXmppDiscoveryManager::setIdentities | ( | const QList< QXmppDiscoIdentity > & | identities | ) |

Sets the base identities of this client.

The identities are added to the service discovery information other entities can request.

Note
  Additionally also all identities reported via QXmppClientExtension::discoveryIdentities() are added.
  The default identity is type=client, category=pc/phone (OS dependent) and name="{application name} {application version}".

Since
  QXmpp 1.12

## ◆ setInfoForms()

void QXmppDiscoveryManager::setInfoForms | ( | const QList< QXmppDataForm > & | dataForms | ) |

Sets the data forms for this client as defined in XEP-0128: Service Discovery Extensions.

The data forms are added to the service discovery information other entities can request.

Since
  QXmpp 1.12

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

- QXmppDiscoveryManager.h
- client/compat/removed_api.cpp
- QXmppDiscoveryManager.cpp