QXmppMovedManager Class
| Header: | #include <QXmppMovedManager.h> |
| Since: | QXmpp 1.9 |
| Inherits: | QXmppClientExtension |
- List of all members, including inherited members
- Deprecated members
- QXmppMovedManager is part of Managers.
Public Types
Properties
- supportedByServer : bool
Public Functions
| QXmppMovedManager() | |
| QXmppTask<QXmpp::SendResult> | notifyContact(const QString &contactBareJid, const QString &oldBareJid, bool sensitive = true, const QString &reason = {}) |
| QXmppTask<QXmppMovedManager::Result> | publishStatement(QString newBareJid) |
| QXmppTask<QXmppMovedManager::Result> | verifyStatement(QString oldBareJid, QString newBareJid) |
(since QXmpp 1.17) QXmppDiscoFeatureWatch | watchServerSupport() const |
Detailed Description
This class manages user account moving as specified in XEP-0283: Moved
In order to use this manager, make sure to add all managers needed by this manager:
client->addNewExtension<QXmppDiscoveryManager>();
client->addNewExtension<QXmppPubSubManager>();
Afterwards, you need to add this manager to the client:
auto *manager = client->addNewExtension<QXmppMovedManager>();
If you want to publish a moved statement use the publishStatement call with the old account:
manager->publishStatement("new@example.org");
Once you published your statement, you then need to subscribe to your old contacts with the new account:
manager->notifyContact("contact@xmpp.example", "old@example.org", "Hey, I moved my account, please accept me.");
When a contact receive a subscription request from a moved user he needs to verify the authenticity of the request. The QXmppRosterManager handle it on its own if the client has the QXmppMovedManager extension available. The request will be ignored entirely if the old jid incoming subscription is not part of the roster with a 'from' or 'both' type. In case of the authenticity can't be established the moved element is ignored entirely. Alternatively, if the client does not has QXmppMovedManager support the request message will be changed to introduce a warning message before emitting the subscription{Request}Received signal.
Property Documentation
[read-only] supportedByServer : bool
See also QXmppMovedManager::supportedByServer().
Member Function Documentation
[explicit] QXmppMovedManager::QXmppMovedManager()
Constructs a XEP-0283: Moved manager.
QXmppTask<QXmpp::SendResult> QXmppMovedManager::notifyContact(const QString &contactBareJid, const QString &oldBareJid, bool sensitive = true, const QString &reason = {})
Notifies a contact that the user has moved to another account.
contactBareJid is the JID of the contact to send the subscription request. oldBareJid is the JID of the old account we moved from. If sensitive is true the notification is sent sensitively. reason is the reason of the move.
Returns the result of the action.
QXmppTask<QXmppMovedManager::Result> QXmppMovedManager::publishStatement(QString newBareJid)
Publish a moved statement. newBareJid is the JID of the new account.
Returns the result of the action.
QXmppTask<QXmppMovedManager::Result> QXmppMovedManager::verifyStatement(QString oldBareJid, QString newBareJid)
Verify a user moved statement.
oldBareJid is the JID of the old account to check statement. newBareJid is the JID of the new account that sent the subscription request.
Returns the result of the action.
[since QXmpp 1.17] QXmppDiscoFeatureWatch QXmppMovedManager::watchServerSupport() const
Returns a watch on whether the own server supports XEP-0283: Moved.
The information is requested as long as a copy of the watch exists and shared with all other watches on the server information.
This requires the QXmppDiscoveryManager to be registered with the client. If the manager is not registered with a client, a watch that never loads is returned.
This function was introduced in QXmpp 1.17.