QXmpp: QXmppDiscoveryManager_p.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppDiscoveryManager_p.h
1// SPDX-FileCopyrightText: 2025 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPDISCOVERYMANAGER_P_H
6#define QXMPPDISCOVERYMANAGER_P_H
7
8#include "QXmppDiscoveryManager.h"
9#include "QXmppPromise.h"
10
11#include "Async.h"
12#include "Iq.h"
13
14#include <QCache>
15
16using namespace QXmpp::Private;
17
18class QXmppDiscoveryManagerPrivate
19{
20public:
21 using StanzaError = QXmppStanza::Error;
22
23 QXmppDiscoveryManager *q = nullptr;
24 QString clientCapabilitiesNode;
25 QList<QXmppDiscoIdentity> identities;
26 QList<QXmppDataForm> dataForms;
27
28 // cached data
29 QCache<std::tuple<QString, QString>, QXmppDiscoInfo> infoCache;
30 QCache<std::tuple<QString, QString>, QList<QXmppDiscoItem>> itemsCache;
31
32 // outgoing requests
33 AttachableRequests<std::tuple<QString, QString>, QXmpp::Result<QXmppDiscoInfo>> infoRequests;
34 AttachableRequests<std::tuple<QString, QString>, QXmpp::Result<QList<QXmppDiscoItem>>> itemsRequests;
35
36 explicit QXmppDiscoveryManagerPrivate(QXmppDiscoveryManager *q) : q(q) { }
37
38 static QString defaultApplicationName();
39 static QXmppDiscoIdentity defaultIdentity();
40
41 std::variant<CompatIq<QXmppDiscoInfo>, StanzaError> handleIq(GetIq<QXmppDiscoInfo> &&iq);
42 std::variant<CompatIq<QXmppDiscoItems>, StanzaError> handleIq(GetIq<QXmppDiscoItems> &&iq);
43};
44
45#endif // QXMPPDISCOVERYMANAGER_P_H
QXmpp::Result
std::variant< T, QXmppError > Result
Definition QXmppGlobal.h:209