aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppClient.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-09-09 15:32:01 +0200
committerLinus Jahn <lnj@kaidan.im>2021-01-09 14:37:47 +0100
commitaf22e07a2300dc18ec62eee30508569062d918b3 (patch)
tree753c28084811c1beac0d1657eb193aa756703e4d /src/client/QXmppClient.cpp
parent8570b4c56616547e5fa2530e6b9733fb37cf02a3 (diff)
downloadqxmpp-af22e07a2300dc18ec62eee30508569062d918b3.tar.gz
QXmppClient: Advertise stream management state
Diffstat (limited to 'src/client/QXmppClient.cpp')
-rw-r--r--src/client/QXmppClient.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client/QXmppClient.cpp b/src/client/QXmppClient.cpp
index 926a9463..6f3c2d57 100644
--- a/src/client/QXmppClient.cpp
+++ b/src/client/QXmppClient.cpp
@@ -350,6 +350,24 @@ void QXmppClient::setActive(bool active)
}
}
+///
+/// Returns the current \xep{0198}: Stream Management state of the connection.
+///
+/// Upon connection of the client this can be used to check whether the
+/// previous stream has been resumed.
+///
+/// \since QXmpp 1.4
+///
+QXmppClient::StreamManagementState QXmppClient::streamManagementState() const
+{
+ if (d->stream->isStreamManagementEnabled()) {
+ if (d->stream->isStreamResumed())
+ return ResumedStream;
+ return NewStream;
+ }
+ return NoStreamManagement;
+}
+
/// Returns the reference to QXmppRosterManager object of the client.
///
/// \return Reference to the roster object of the connected client. Use this to