QXmpp Version: 1.10.0
|
Public Types | |
using | Result = std::variant< QXmpp::Success, QXmppError > |
Public Member Functions | |
QXmppMovedManager () | |
QStringList | discoveryFeatures () const override |
bool | supportedByServer () const |
Q_SIGNAL void | supportedByServerChanged () |
QXmppTask< Result > | publishStatement (const QString &newBareJid) |
QXmppTask< Result > | verifyStatement (const QString &oldBareJid, const QString &newBareJid) |
QXmppTask< QXmpp::SendResult > | notifyContact (const QString &contactBareJid, const QString &oldBareJid, bool sensitive=true, const QString &reason={}) |
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) | |
Properties | |
bool | supportedByServer |
Friends | |
class | QXmppRosterManager |
class | tst_QXmppMovedManager |
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) |
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:
Afterwards, you need to add this manager to the client:
If you want to publish a moved statement use the publishStatement call with the old account:
Once you published your statement, you then need to subscribe to your old contacts with the new account:
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.
Contains QXmpp::Success or an error.
|
explicit |
Constructs a XEP-0283: Moved manager.
|
overridevirtual |
Returns the discovery features to add to the client.
Reimplemented from QXmppClientExtension.
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 | JID of the contact to send the subscription request |
oldBareJid | JID of the old account we moved from |
sensitive | If true the notification is sent sensitively |
reason | The reason of the move |
QXmppTask< QXmppClient::EmptyResult > QXmppMovedManager::publishStatement | ( | const QString & | newBareJid | ) |
Publish a moved statement.
newBareJid | JID of the new account |
bool QXmppMovedManager::supportedByServer | ( | ) | const |
Returns whether the own server supports XEP-0283: Moved feature.
QXmppMovedManager::supportedByServerChanged | ( | ) |
Emitted when the server enabled or disabled support for XEP-0283: Moved.
QXmppTask< QXmppMovedManager::Result > QXmppMovedManager::verifyStatement | ( | const QString & | oldBareJid, |
const QString & | newBareJid | ||
) |
Verify a user moved statement.
oldBareJid | JID of the old account to check statement |
newBareJid | JID of the new account that send the subscription request |
|
read |