From c02547eff8d35d8cbee7869329820dc582cc3949 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Mon, 23 Aug 2010 07:55:15 +0000 Subject: add isConnected() methods to all streams --- src/QXmppOutgoingClient.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/QXmppOutgoingClient.cpp') diff --git a/src/QXmppOutgoingClient.cpp b/src/QXmppOutgoingClient.cpp index f9f939b2..145f5b1d 100644 --- a/src/QXmppOutgoingClient.cpp +++ b/src/QXmppOutgoingClient.cpp @@ -81,6 +81,7 @@ public: QString bindId; QString sessionId; bool sessionAvailable; + bool sessionStarted; QString streamId; QString streamFrom; QString streamVersion; @@ -156,6 +157,14 @@ void QXmppOutgoingClient::connectToHost() configuration().port()); } +/// Returns true if the socket is connected and a session has been started. +/// + +bool QXmppOutgoingClient::isConnected() const +{ + return QXmppStream::isConnected() && d->sessionStarted; +} + void QXmppOutgoingClient::socketSslErrors(const QList & error) { warning("SSL errors"); @@ -177,6 +186,7 @@ void QXmppOutgoingClient::handleStart() { // reset authentication step d->authStep = 0; + d->sessionStarted = false; // start stream QByteArray data = "