Loading...
Searching...
No Matches
QXmppIncomingServer.h
// SPDX-FileCopyrightText: 2010 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPINCOMINGSERVER_H
#define QXMPPINCOMINGSERVER_H
#include "QXmppLogger.h"
#include <memory>
class QDomElement;
class QSslSocket;
class QXmppDialback;
class QXmppIncomingServerPrivate;
class QXmppNonza;
namespace QXmpp::Private {
struct StreamOpen;
}
class QXMPP_EXPORT QXmppIncomingServer : public QXmppLoggable
{
Q_OBJECT
public:
QXmppIncomingServer(QSslSocket *socket, const QString &domain, QObject *parent);
~QXmppIncomingServer() override;
bool isConnected() const;
void disconnectFromHost();
QString localStreamId() const;
bool sendPacket(const QXmppNonza &);
Q_SLOT bool sendData(const QByteArray &);
Q_SIGNAL void connected();
Q_SIGNAL void disconnected();
Q_SIGNAL void dialbackRequestReceived(const QXmppDialback &result);
Q_SIGNAL void elementReceived(const QDomElement &element);
private:
void handleStart();
void handleStanza(const QDomElement &element);
void handleStream(const QXmpp::Private::StreamOpen &element);
void slotDialbackResponseReceived(const QXmppDialback &dialback);
void slotSocketDisconnected();
const std::unique_ptr<QXmppIncomingServerPrivate> d;
friend class QXmppIncomingServerPrivate;
};
#endif
QXmppDialback
The QXmppDialback class represents a stanza used for the Server Dialback protocol as specified by XEP...
Definition QXmppDialback.h:16
QXmppIncomingServer::connected
Q_SIGNAL void connected()
This signal is emitted when the stream is connected.
QXmppIncomingServer::disconnected
Q_SIGNAL void disconnected()
This signal is emitted when the stream is disconnected.
QXmppIncomingServer::disconnectFromHost
void disconnectFromHost()
Disconnects from the remote host.
Definition QXmppIncomingServer.cpp:88
QXmppIncomingServer::sendPacket
bool sendPacket(const QXmppNonza &)
Sends an XMPP packet to the peer.
Definition QXmppIncomingServer.cpp:100
QXmppIncomingServer::QXmppIncomingServer
QXmppIncomingServer(QSslSocket *socket, const QString &domain, QObject *parent)
Definition QXmppIncomingServer.cpp:63
QXmppIncomingServer::sendData
Q_SLOT bool sendData(const QByteArray &)
Sends raw data to the peer.
Definition QXmppIncomingServer.cpp:106
QXmppIncomingServer::localStreamId
QString localStreamId() const
Returns the stream's identifier.
Definition QXmppIncomingServer.cpp:94
QXmppIncomingServer::isConnected
bool isConnected() const
Definition QXmppIncomingServer.cpp:82
QXmppIncomingServer::elementReceived
Q_SIGNAL void elementReceived(const QDomElement &element)
This signal is emitted when an element is received.
QXmppIncomingServer::dialbackRequestReceived
Q_SIGNAL void dialbackRequestReceived(const QXmppDialback &result)
This signal is emitted when a dialback verify request is received.
QXmppLoggable::QXmppLoggable
QXmppLoggable(QObject *parent=nullptr)
Definition QXmppLogger.cpp:57
QXmppNonza
Definition QXmppNonza.h:14