diff options
Diffstat (limited to 'Swiften/StreamStack/StreamStack.cpp')
-rw-r--r-- | Swiften/StreamStack/StreamStack.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Swiften/StreamStack/StreamStack.cpp b/Swiften/StreamStack/StreamStack.cpp index 5cb96de..44a018d 100644 --- a/Swiften/StreamStack/StreamStack.cpp +++ b/Swiften/StreamStack/StreamStack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,31 +8,30 @@ #include <boost/bind.hpp> -#include <Swiften/Base/foreach.h> -#include <Swiften/StreamStack/XMPPLayer.h> #include <Swiften/StreamStack/LowLayer.h> #include <Swiften/StreamStack/StreamLayer.h> +#include <Swiften/StreamStack/XMPPLayer.h> namespace Swift { StreamStack::StreamStack(XMPPLayer* xmppLayer, LowLayer* physicalLayer) : xmppLayer_(xmppLayer), physicalLayer_(physicalLayer) { - physicalLayer_->setParentLayer(xmppLayer_); - xmppLayer_->setChildLayer(physicalLayer_); + physicalLayer_->setParentLayer(xmppLayer_); + xmppLayer_->setChildLayer(physicalLayer_); } StreamStack::~StreamStack() { } void StreamStack::addLayer(StreamLayer* newLayer) { - LowLayer* lowLayer = layers_.empty() ? physicalLayer_ : *layers_.rbegin(); + LowLayer* lowLayer = layers_.empty() ? physicalLayer_ : *layers_.rbegin(); + + xmppLayer_->setChildLayer(newLayer); + newLayer->setParentLayer(xmppLayer_); - xmppLayer_->setChildLayer(newLayer); - newLayer->setParentLayer(xmppLayer_); - - lowLayer->setParentLayer(newLayer); - newLayer->setChildLayer(lowLayer); + lowLayer->setParentLayer(newLayer); + newLayer->setChildLayer(lowLayer); - layers_.push_back(newLayer); + layers_.push_back(newLayer); } } |