aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/QXmppClient.cpp8
-rw-r--r--source/QXmppClient.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/source/QXmppClient.cpp b/source/QXmppClient.cpp
index bdd91cfa..3b674817 100644
--- a/source/QXmppClient.cpp
+++ b/source/QXmppClient.cpp
@@ -260,6 +260,14 @@ void QXmppClient::disconnect()
}
}
+/// Returns true if the client is connected to the XMPP server.
+///
+
+bool QXmppClient::isConnected() const
+{
+ return m_stream && m_stream->isConnected();
+}
+
/// Returns the reference to QXmppRoster object of the client.
/// \return Reference to the roster object of the connected client. Use this to
/// get the list of friends in the roster and their presence information.
diff --git a/source/QXmppClient.h b/source/QXmppClient.h
index 9a367f90..55bd5297 100644
--- a/source/QXmppClient.h
+++ b/source/QXmppClient.h
@@ -101,6 +101,7 @@ public:
const QXmppPresence& initialPresence =
QXmppPresence());
void disconnect();
+ bool isConnected() const;
QXmppArchiveManager& archiveManager();
QXmppMucManager& mucManager();