QXmpp: QXmppMovedManager.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppMovedManager.h
1// SPDX-FileCopyrightText: 2024 Filipe Azevedo <pasnox@gmail.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPMOVEDMANAGER_H
6#define QXMPPMOVEDMANAGER_H
7
8#include "QXmppClientExtension.h"
9#include "QXmppSendResult.h"
10#include "QXmppTask.h"
11
12class QXmppPresence;
13struct QXmppError;
14class QXmppMovedManagerPrivate;
15
16 class QXMPP_EXPORT QXmppMovedManager : public QXmppClientExtension
17{
18 Q_OBJECT
19 Q_PROPERTY(bool supportedByServer READ supportedByServer NOTIFY supportedByServerChanged)
20
21public:
22 using Result = std::variant<QXmpp::Success, QXmppError>;
23
24 explicit QXmppMovedManager();
25 ~QXmppMovedManager() override;
26
27 QStringList discoveryFeatures() const override;
28
29 bool supportedByServer() const;
30 Q_SIGNAL void supportedByServerChanged();
31
32 QXmppTask<Result> publishStatement(const QString &newBareJid);
33 QXmppTask<Result> verifyStatement(const QString &oldBareJid, const QString &newBareJid);
34
35 QXmppTask<QXmpp::SendResult> notifyContact(const QString &contactBareJid, const QString &oldBareJid, bool sensitive = true, const QString &reason = {});
36
37protected:
39 void onRegistered(QXmppClient *client) override;
40 void onUnregistered(QXmppClient *client) override;
42
43private:
44 QXmppTask<QXmppPresence> processSubscriptionRequest(QXmppPresence presence);
45
46 void setSupportedByServer(bool supportedByServer);
47 void resetCachedData();
48
49 const std::unique_ptr<QXmppMovedManagerPrivate> d;
50
51 friend class QXmppRosterManager;
52 friend class tst_QXmppMovedManager;
53};
54
55#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