Loading...
Searching...
No Matches
QXmppMovedManager.h
// SPDX-FileCopyrightText: 2024 Filipe Azevedo <pasnox@gmail.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPMOVEDMANAGER_H
#define QXMPPMOVEDMANAGER_H
#include "QXmppClientExtension.h"
#include "QXmppSendResult.h"
#include "QXmppTask.h"
class QXmppPresence;
struct QXmppError;
class QXmppMovedManagerPrivate;
class QXMPP_EXPORT QXmppMovedManager : public QXmppClientExtension
{
Q_OBJECT
Q_PROPERTY(bool supportedByServer READ supportedByServer NOTIFY supportedByServerChanged)
public:
using Result = std::variant<QXmpp::Success, QXmppError>;
explicit QXmppMovedManager();
~QXmppMovedManager() override;
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 = {});
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
QXmppTask<QXmppPresence> processSubscriptionRequest(QXmppPresence presence);
void setSupportedByServer(bool supportedByServer);
void resetCachedData();
const std::unique_ptr<QXmppMovedManagerPrivate> d;
friend class QXmppRosterManager;
friend class tst_QXmppMovedManager;
};
#endif // QXMPPMOVEDMANAGER_H
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::onUnregistered
virtual void onUnregistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:95
QXmppClientExtension::onRegistered
virtual void onRegistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:85
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
QXmppClient
Main class for starting and managing connections to XMPP servers.
Definition QXmppClient.h:62
QXmppMovedManager::supportedByServer
bool supportedByServer
Definition QXmppMovedManager.h:19
QXmppMovedManager::Result
std::variant< QXmpp::Success, QXmppError > Result
Definition QXmppMovedManager.h:22
QXmppMovedManager::publishStatement
QXmppTask< Result > publishStatement(const QString &newBareJid)
Definition QXmppMovedManager.cpp:168
QXmppMovedManager::supportedByServerChanged
Q_SIGNAL void supportedByServerChanged()
QXmppMovedManager::notifyContact
QXmppTask< QXmpp::SendResult > notifyContact(const QString &contactBareJid, const QString &oldBareJid, bool sensitive=true, const QString &reason={})
Definition QXmppMovedManager.cpp:234
QXmppMovedManager::verifyStatement
QXmppTask< Result > verifyStatement(const QString &oldBareJid, const QString &newBareJid)
Definition QXmppMovedManager.cpp:181
QXmppMovedManager::QXmppMovedManager
QXmppMovedManager()
Definition QXmppMovedManager.cpp:127
QXmppPresence
The QXmppPresence class represents an XMPP presence stanza.
Definition QXmppPresence.h:22
QXmppRosterManager
The QXmppRosterManager class provides access to a connected client's roster.
Definition QXmppRosterManager.h:84
QXmppTask
Definition QXmppTask.h:46
QXmppError
Definition QXmppError.h:17