diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-09-11 13:46:08 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-09-11 14:02:39 (GMT) |
commit | 1b47266d6b955fb533b4c272b4bcc58693078a1a (patch) | |
tree | dd52b86408a03308c84c33674989d2d75af58893 /Swiften/Client/ClientSession.cpp | |
parent | 5e235d01612b2544fe02cc34816cd6e925ed564f (diff) | |
download | swift-contrib-1b47266d6b955fb533b4c272b4bcc58693078a1a.zip swift-contrib-1b47266d6b955fb533b4c272b4bcc58693078a1a.tar.bz2 |
Disable WhitespacePingLayer on disconnect + Timer refactoring.
Timer now no longer runs in its own thread, but in the main Boost
IOService thread.
Diffstat (limited to 'Swiften/Client/ClientSession.cpp')
-rw-r--r-- | Swiften/Client/ClientSession.cpp | 5 |
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; |