summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-15 16:15:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-15 16:15:57 (GMT)
commit062658db9f46ef749eeec09c162e5afaf1524ab6 (patch)
tree12ea883e39c7d938310ea715c71127bc1801319c /Swiften/Session
parentf52aa93c3d6d5976b072d31f3d3336beb1596ece (diff)
downloadswift-062658db9f46ef749eeec09c162e5afaf1524ab6.zip
swift-062658db9f46ef749eeec09c162e5afaf1524ab6.tar.bz2
Added Component parser, serializer, element, and connector.
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/BasicSessionStream.cpp4
-rw-r--r--Swiften/Session/BasicSessionStream.h4
-rw-r--r--Swiften/Session/Session.cpp2
3 files changed, 7 insertions, 3 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp
index d75e2c3..e2c2ebe 100644
--- a/Swiften/Session/BasicSessionStream.cpp
+++ b/Swiften/Session/BasicSessionStream.cpp
@@ -18,12 +18,12 @@
namespace Swift {
-BasicSessionStream::BasicSessionStream(boost::shared_ptr<Connection> connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, TLSLayerFactory* tlsLayerFactory, TimerFactory* timerFactory) : available(false), connection(connection), payloadParserFactories(payloadParserFactories), payloadSerializers(payloadSerializers), tlsLayerFactory(tlsLayerFactory), timerFactory(timerFactory) {
+BasicSessionStream::BasicSessionStream(StreamType streamType, boost::shared_ptr<Connection> connection, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, TLSLayerFactory* tlsLayerFactory, TimerFactory* timerFactory) : available(false), connection(connection), payloadParserFactories(payloadParserFactories), payloadSerializers(payloadSerializers), tlsLayerFactory(tlsLayerFactory), timerFactory(timerFactory), streamType(streamType) {
}
void BasicSessionStream::initialize() {
xmppLayer = boost::shared_ptr<XMPPLayer>(
- new XMPPLayer(payloadParserFactories, payloadSerializers));
+ new XMPPLayer(payloadParserFactories, payloadSerializers, streamType));
xmppLayer->onStreamStart.connect(boost::bind(&BasicSessionStream::handleStreamStartReceived, shared_from_this(), _1));
xmppLayer->onElement.connect(boost::bind(&BasicSessionStream::handleElementReceived, shared_from_this(), _1));
xmppLayer->onError.connect(boost::bind(
diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h
index 7f194ff..bea9406 100644
--- a/Swiften/Session/BasicSessionStream.h
+++ b/Swiften/Session/BasicSessionStream.h
@@ -11,6 +11,7 @@
#include "Swiften/Network/Connection.h"
#include "Swiften/Session/SessionStream.h"
+#include "Swiften/Elements/StreamType.h"
namespace Swift {
class TLSLayerFactory;
@@ -29,6 +30,7 @@ namespace Swift {
public boost::enable_shared_from_this<BasicSessionStream> {
public:
BasicSessionStream(
+ StreamType streamType,
boost::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
@@ -72,6 +74,7 @@ namespace Swift {
PayloadSerializerCollection* payloadSerializers;
TLSLayerFactory* tlsLayerFactory;
TimerFactory* timerFactory;
+ StreamType streamType;
boost::shared_ptr<XMPPLayer> xmppLayer;
boost::shared_ptr<ConnectionLayer> connectionLayer;
StreamStack* streamStack;
@@ -79,4 +82,5 @@ namespace Swift {
boost::shared_ptr<TLSLayer> tlsLayer;
boost::shared_ptr<WhitespacePingLayer> whitespacePingLayer;
};
+
}
diff --git a/Swiften/Session/Session.cpp b/Swiften/Session/Session.cpp
index 34845dc..747d1d9 100644
--- a/Swiften/Session/Session.cpp
+++ b/Swiften/Session/Session.cpp
@@ -51,7 +51,7 @@ void Session::finishSession(const SessionError& error) {
void Session::initializeStreamStack() {
xmppLayer = boost::shared_ptr<XMPPLayer>(
- new XMPPLayer(payloadParserFactories, payloadSerializers));
+ new XMPPLayer(payloadParserFactories, payloadSerializers, ClientStreamType));
xmppLayer->onStreamStart.connect(
boost::bind(&Session::handleStreamStart, shared_from_this(), _1));
xmppLayer->onElement.connect(boost::bind(&Session::handleElement, shared_from_this(), _1));