QXmpp Version: 1.12.0
Loading...
Searching...
No Matches
QXmppOutgoingServer.h
1// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPOUTGOINGSERVER_H
6#define QXMPPOUTGOINGSERVER_H
7
8#include "QXmppLogger.h"
9#include "QXmppStreamError.h"
10
11#include <QAbstractSocket>
12
13class QDomElement;
14class QSslError;
15class QXmppDialback;
16class QXmppNonza;
18class QXmppOutgoingServerPrivate;
19
20namespace QXmpp::Private {
21struct StreamOpen;
22}
23
28class QXMPP_EXPORT QXmppOutgoingServer : public QXmppLoggable
29{
30 Q_OBJECT
31
32public:
33 QXmppOutgoingServer(const QString &domain, QObject *parent);
34 ~QXmppOutgoingServer() override;
35
36 bool isConnected() const;
37 Q_SLOT void connectToHost(const QString &domain);
38 void disconnectFromHost();
39 Q_SLOT void queueData(const QByteArray &data);
40
42 Q_SIGNAL void connected();
44 Q_SIGNAL void disconnected();
45
46 bool sendData(const QByteArray &);
47 bool sendPacket(const QXmppNonza &);
48
49 QString localStreamKey() const;
50 void setLocalStreamKey(const QString &key);
51 void setVerify(const QString &id, const QString &key);
52
53 QString remoteDomain() const;
54
56 Q_SIGNAL void dialbackResponseReceived(const QXmppDialback &response);
57
58private:
59 void handleStart();
60 void handleStream(const QXmpp::Private::StreamOpen &streamElement);
61 void handleStanza(const QDomElement &stanzaElement);
62
63 void onDnsLookupFinished();
64 void onSocketDisconnected();
65 void sendDialback();
66 void slotSslErrors(const QList<QSslError> &errors);
67 void onSocketError(const QString &text, std::variant<QXmpp::StreamError, QAbstractSocket::SocketError> error);
68
69 const std::unique_ptr<QXmppOutgoingServerPrivate> d;
70};
71
72#endif
The QXmppDialback class represents a stanza used for the Server Dialback protocol as specified by XEP...
Definition QXmppDialback.h:16
The QXmppLoggable class represents a source of logging messages.
Definition QXmppLogger.h:110
Definition QXmppNonza.h:14
The QXmppOutgoingServer class represents an outgoing XMPP stream to another XMPP server.
Definition QXmppOutgoingServer.h:29
Q_SIGNAL void connected()
This signal is emitted when the stream is connected.
Q_SIGNAL void disconnected()
This signal is emitted when the stream is disconnected.
Q_SIGNAL void dialbackResponseReceived(const QXmppDialback &response)
This signal is emitted when a dialback verify response is received.