summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp7
-rw-r--r--Swiften/Server/ServerFromClientSession.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index e85021e..be8b601 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -10,15 +10,17 @@
namespace Swift {
ServerFromClientSession::ServerFromClientSession(
+ const String& id,
boost::shared_ptr<IncomingConnection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers) :
+ id_(id),
connection_(connection),
payloadParserFactories_(payloadParserFactories),
payloadSerializers_(payloadSerializers) {
xmppLayer_ = new XMPPLayer(payloadParserFactories_, payloadSerializers_);
xmppLayer_->onStreamStart.connect(
- boost::bind(&ServerFromClientSession::handleStreamStart, this, _1));
+ boost::bind(&ServerFromClientSession::handleStreamStart, this, _2));
xmppLayer_->onElement.connect(
boost::bind(&ServerFromClientSession::handleElement, this, _1));
//xmppLayer_->onError.connect(
@@ -41,7 +43,8 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element>) {
}
void ServerFromClientSession::handleStreamStart(const String& domain) {
- xmppLayer_->writeHeader(domain);
+ domain_ = domain;
+ xmppLayer_->writeHeader(domain_, id_);
}
}
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index cedfcdb..3413a03 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -3,6 +3,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/signal.hpp>
+#include "Swiften/Base/String.h"
+
namespace Swift {
class Element;
class PayloadParserFactoryCollection;
@@ -12,11 +14,11 @@ namespace Swift {
class IncomingConnectionLayer;
class IncomingConnection;
class ByteArray;
- class String;
class ServerFromClientSession {
public:
ServerFromClientSession(
+ const String& id,
boost::shared_ptr<IncomingConnection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers);
@@ -31,11 +33,13 @@ namespace Swift {
void handleStreamStart(const String& domain);
private:
+ String id_;
boost::shared_ptr<IncomingConnection> connection_;
PayloadParserFactoryCollection* payloadParserFactories_;
PayloadSerializerCollection* payloadSerializers_;
IncomingConnectionLayer* connectionLayer_;
StreamStack* streamStack_;
XMPPLayer* xmppLayer_;
+ String domain_;
};
}