summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/BasicSessionStream.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp
index 8b14367..807470e 100644
--- a/Swiften/Session/BasicSessionStream.cpp
+++ b/Swiften/Session/BasicSessionStream.cpp
@@ -75,14 +75,14 @@ void BasicSessionStream::addTLSEncryption() {
}
void BasicSessionStream::setWhitespacePingEnabled(bool enabled) {
- if (enabled && !whitespacePingLayer) {
- whitespacePingLayer = boost::shared_ptr<WhitespacePingLayer>(new WhitespacePingLayer());
- streamStack->addLayer(whitespacePingLayer);
- }
if (enabled) {
+ if (!whitespacePingLayer) {
+ whitespacePingLayer = boost::shared_ptr<WhitespacePingLayer>(new WhitespacePingLayer());
+ streamStack->addLayer(whitespacePingLayer);
+ }
whitespacePingLayer->setActive();
}
- else {
+ else if (whitespacePingLayer) {
whitespacePingLayer->setInactive();
}
}