From af22e07a2300dc18ec62eee30508569062d918b3 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 9 Sep 2020 15:32:01 +0200 Subject: QXmppClient: Advertise stream management state --- src/client/QXmppClient.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/client/QXmppClient.cpp') 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 -- cgit v1.2.3