QXmpp Version: 1.10.0
|
Allows to export and import account data. More...
Public Types | |
template<typename T = QXmpp::Success> | |
using | Result = std::variant< T, QXmppError > |
Public Member Functions | |
QXmppAccountMigrationManager () | |
QXmppTask< Result<> > | importData (const QXmppExportData &account) |
QXmppTask< Result< QXmppExportData > > | exportData () |
template<typename DataType , typename ImportFunc , typename ExportFunc > | |
void | registerExportData (ImportFunc importFunc, ExportFunc exportFunc) |
template<typename DataType > | |
void | unregisterExportData () |
Q_SIGNAL void | errorOccurred (const QXmppError &error) |
Public Member Functions inherited from QXmppClientExtension | |
QXmppClientExtension () | |
virtual QStringList | discoveryFeatures () const |
virtual QList< QXmppDiscoveryIq::Identity > | discoveryIdentities () const |
virtual bool | handleStanza (const QDomElement &stanza) |
You need to implement this method to process incoming XMPP stanzas. More... | |
virtual bool | handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata) |
You need to implement this method to process incoming XMPP stanzas. More... | |
Public Member Functions inherited from QXmppLoggable | |
QXmppLoggable (QObject *parent=nullptr) | |
Friends | |
struct | QXmppAccountMigrationManagerPrivate |
Additional Inherited Members | |
Signals inherited from QXmppLoggable | |
void | setGauge (const QString &gauge, double value) |
Sets the given gauge to value. | |
void | logMessage (QXmppLogger::MessageType type, const QString &msg) |
This signal is emitted to send logging messages. | |
void | updateCounter (const QString &counter, qint64 amount=1) |
Updates the given counter by amount. | |
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) |
void | info (const QString &message) |
void | warning (const QString &message) |
void | logReceived (const QString &message) |
void | logSent (const QString &message) |
Allows to export and import account data.
You can use exportData() to start a data export. Afterwards you can use the exported data to start a data import on another account using importData().
The data that is exported (or imported) is determined by the other registered client extensions. They can register callbacks for export and import using registerExtension().
This manager help migrating a user account into another server.
QXmppAccountMigrationManager::Result |
Contains T or QXmppError.
QXmppAccountMigrationManager::QXmppAccountMigrationManager | ( | ) |
Constructs an account migration manager.
QXmppClient(QXmppClient::NoExtensions, this)
approach to use this manager because it needs to be instantiated before others using it. QXmppAccountMigrationManager::errorOccurred | ( | const QXmppError & | error | ) |
Emitted when an error occured during export or import.
error | The occured error |
QXmppTask< QXmppAccountMigrationManager::Result< QXmppExportData > > QXmppAccountMigrationManager::exportData | ( | ) |
Creates a data export of the current account.
QXmppTask< QXmppAccountMigrationManager::Result<> > QXmppAccountMigrationManager::importData | ( | const QXmppExportData & | account | ) |
Imports QXmppExportData to the currently connected account.
void QXmppAccountMigrationManager::registerExportData | ( | ImportFunc | importFunc, |
ExportFunc | exportFunc | ||
) |
Registers a data type that can be imported to an account using importFunc and generated using exportFunc.
The functions are used when importData() or exportData() is called. You can unregister the functions using unregisterExportData().
The data type MUST also be registered via QXmppExportData::registerExtension() so it can be serialized.
void QXmppAccountMigrationManager::unregisterExportData |
Unregisters a data type.