summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/StreamStack/WhitespacePingLayer.cpp')
-rw-r--r--Swiften/StreamStack/WhitespacePingLayer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/StreamStack/WhitespacePingLayer.cpp b/Swiften/StreamStack/WhitespacePingLayer.cpp
index 25e4436..939c4fa 100644
--- a/Swiften/StreamStack/WhitespacePingLayer.cpp
+++ b/Swiften/StreamStack/WhitespacePingLayer.cpp
@@ -8,7 +8,7 @@ namespace Swift {
static const int TIMEOUT_MILLISECONDS = 60000;
-WhitespacePingLayer::WhitespacePingLayer() {
+WhitespacePingLayer::WhitespacePingLayer() : isActive(false) {
// FIXME: Create a BoostTimerFactory.
timer = boost::shared_ptr<Timer>(new Timer(TIMEOUT_MILLISECONDS, &MainBoostIOServiceThread::getInstance().getIOService()));
timer->onTick.connect(boost::bind(&WhitespacePingLayer::handleTimerTick, this));
@@ -27,11 +27,13 @@ void WhitespacePingLayer::handleTimerTick() {
}
void WhitespacePingLayer::setActive() {
+ isActive = true;
timer->start();
}
void WhitespacePingLayer::setInactive() {
timer->stop();
+ isActive = false;
}
}