summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/ClientSession.cpp')
-rw-r--r--Swiften/Client/ClientSession.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp
index 1409195..ae98ee6 100644
--- a/Swiften/Client/ClientSession.cpp
+++ b/Swiften/Client/ClientSession.cpp
@@ -96,6 +96,7 @@ void ClientSession::handleElement(boost::shared_ptr<Element> element) {
// Add a whitespace ping layer
whitespacePingLayer_ = boost::shared_ptr<WhitespacePingLayer>(new WhitespacePingLayer());
getStreamStack()->addLayer(whitespacePingLayer_);
+ whitespacePingLayer_->setActive();
if (streamFeatures->hasSession()) {
needSessionStart_ = true;
@@ -196,6 +197,10 @@ void ClientSession::sendSessionStart() {
}
void ClientSession::handleSessionFinished(const boost::optional<SessionError>& error) {
+ if (whitespacePingLayer_) {
+ whitespacePingLayer_->setInactive();
+ }
+
if (error) {
//assert(!error_);
state_ = Error;