QXmpp: QXmppMamManager Class Reference

QXmpp Version: 1.14.3

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

The QXmppMamManager class makes it possible to access message archives as defined by XEP-0313: Message Archive Management. More...

`#include <QXmppMamManager.h>`

Inheritance diagram for QXmppMamManager:

## Classes
struct | RetrievedMessages
| Contains all retrieved messages and the result IQ that can be used for pagination. More...

## Public Types
using | RetrieveResult = std::variant<RetrievedMessages, QXmppError>

## Public Member Functions
QString | retrieveArchivedMessages (const QString &to=QString(), const QString &node=QString(), const QString &jid=QString(), const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime(), const QXmppResultSetQuery &resultSetQuery=QXmppResultSetQuery())
QXmppTask< RetrieveResult > | retrieveMessages (const QString &to=QString(), const QString &node=QString(), const QString &jid=QString(), const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime(), const QXmppResultSetQuery &resultSetQuery=QXmppResultSetQuery())
Q_SIGNAL void | archivedMessageReceived (const QString &queryId, const QXmppMessage &message)
| This signal is emitted when an archived message is received.
Q_SIGNAL void | resultsRecieved (const QString &queryId, const QXmppResultSetReply &resultSetReply, bool complete)
| This signal is emitted when all results for a request have been received.
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.

## 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 QXmppMamManager class makes it possible to access message archives as defined by XEP-0313: Message Archive Management.

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

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

Since
  QXmpp 1.0

## Member Typedef Documentation

## ◆ RetrieveResult

using QXmppMamManager::RetrieveResult = std::variant<RetrievedMessages, QXmppError>

Contains RetrievedMessages or an QXmppError.

Since
  QXmpp 1.5

## Member Function Documentation

## ◆ retrieveArchivedMessages()

QString QXmppMamManager::retrieveArchivedMessages | ( | const QString & | to = QString(),
|  | const QString & | node = QString(),
|  | const QString & | jid = QString(),
|  | const QDateTime & | start = QDateTime(),
|  | const QDateTime & | end = QDateTime(),
|  | const QXmppResultSetQuery & | resultSetQuery = QXmppResultSetQuery() )

Retrieves archived messages. For each received message, the archiveMessageReceived() signal is emitted. Once all messages are received, the resultsRecieved() signal is emitted. It returns a result set that can be used to page through the results. The number of results may be limited by the server.

Warning
  This API does not work with end-to-end encrypted messages. You can use the new QFuture-based API (retrieveMessages()) for that.

Parameters

  to | Optional entity that should be queried. Leave this empty to query the local archive.
  node | Optional node that should be queried. This is used when querying a pubsub node.
  jid | Optional JID to filter the results.
  start | Optional start time to filter the results.
  end | Optional end time to filter the results.
  resultSetQuery | Optional Result Set Management query. This can be used to limit the number of results and to page through the archive.

Returns
  query id of the request. This can be used to associate the corresponding resultsRecieved signal.

## ◆ retrieveMessages()

QXmppTask< QXmppMamManager::RetrieveResult > QXmppMamManager::retrieveMessages | ( | const QString & | to = QString(),
|  | const QString & | node = QString(),
|  | const QString & | jid = QString(),
|  | const QDateTime & | start = QDateTime(),
|  | const QDateTime & | end = QDateTime(),
|  | const QXmppResultSetQuery & | resultSetQuery = QXmppResultSetQuery() )

Retrieves archived messages and reports all messages at once via a QFuture.

This function tries to decrypt encrypted messages.

The number of results may be limited by the server.

Parameters

  to | Optional entity that should be queried. Leave this empty to query the local archive.
  node | Optional node that should be queried. This is used when querying a pubsub node.
  jid | Optional JID to filter the results.
  start | Optional start time to filter the results.
  end | Optional end time to filter the results.
  resultSetQuery | Optional Result Set Management query. This can be used to limit the number of results and to page through the archive.

Returns
  result of the query

Since
  QXmpp 1.5

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

- QXmppMamManager.h
- QXmppMamManager.cpp