diff options
Diffstat (limited to 'Swiften/Server')
-rw-r--r-- | Swiften/Server/ServerFromClientSession.cpp | 12 | ||||
-rw-r--r-- | Swiften/Server/ServerFromClientSession.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp index 9a3cf83..45df3be 100644 --- a/Swiften/Server/ServerFromClientSession.cpp +++ b/Swiften/Server/ServerFromClientSession.cpp @@ -2,6 +2,7 @@ #include <boost/bind.hpp> +#include "Swiften/Elements/ProtocolHeader.h" #include "Swiften/Server/UserRegistry.h" #include "Swiften/Network/Connection.h" #include "Swiften/StreamStack/StreamStack.h" @@ -42,7 +43,7 @@ ServerFromClientSession::~ServerFromClientSession() { void ServerFromClientSession::start() { xmppLayer_->onStreamStart.connect( - boost::bind(&ServerFromClientSession::handleStreamStart, this, _2)); + boost::bind(&ServerFromClientSession::handleStreamStart, this, _1)); xmppLayer_->onElement.connect( boost::bind(&ServerFromClientSession::handleElement, this, _1)); //xmppLayer_->onError.connect( @@ -99,9 +100,12 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element> element) } } -void ServerFromClientSession::handleStreamStart(const String& domain) { - domain_ = JID("", domain); - xmppLayer_->writeHeader(domain, id_); +void ServerFromClientSession::handleStreamStart(const ProtocolHeader& incomingHeader) { + domain_ = JID("", incomingHeader.getTo()); + ProtocolHeader header; + header.setFrom(incomingHeader.getTo()); + header.setID(id_); + xmppLayer_->writeHeader(header); boost::shared_ptr<StreamFeatures> features(new StreamFeatures()); if (!authenticated_) { diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h index e7df99d..733c428 100644 --- a/Swiften/Server/ServerFromClientSession.h +++ b/Swiften/Server/ServerFromClientSession.h @@ -9,6 +9,7 @@ #include "Swiften/Network/Connection.h" namespace Swift { + class ProtocolHeader; class Element; class Stanza; class PayloadParserFactoryCollection; @@ -51,7 +52,7 @@ namespace Swift { private: void handleDisconnected(const boost::optional<Connection::Error>& error); void handleElement(boost::shared_ptr<Element>); - void handleStreamStart(const String& domain); + void handleStreamStart(const ProtocolHeader& header); private: String id_; |