summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/IncomingLinkLocalSession.cpp')
-rw-r--r--Swiften/LinkLocal/IncomingLinkLocalSession.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
index b73e979..a1fb901 100644
--- a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
@@ -18,23 +18,17 @@ IncomingLinkLocalSession::IncomingLinkLocalSession(
boost::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers) :
- LinkLocalSession(
- localJID,
- connection,
- payloadParserFactories,
- payloadSerializers) {
-}
-
-void IncomingLinkLocalSession::start() {
- initializeStreamStack();
+ Session(connection, payloadParserFactories, payloadSerializers) {
+ setLocalJID(localJID);
}
void IncomingLinkLocalSession::handleStreamStart(const ProtocolHeader& incomingHeader) {
- remoteJID_ = JID(incomingHeader.getFrom());
- if (!remoteJID_.isValid()) {
+ setRemoteJID(JID(incomingHeader.getFrom()));
+ if (!getRemoteJID().isValid()) {
finishSession();
return;
}
+
ProtocolHeader header;
header.setFrom(getLocalJID());
getXMPPLayer()->writeHeader(header);
@@ -55,14 +49,7 @@ void IncomingLinkLocalSession::handleElement(boost::shared_ptr<Element> element)
setInitialized();
}
- if (isInitialized()) {
- if (stanza) {
- onElementReceived(stanza);
- }
- else {
- std::cerr << "Received unexpected element" << std::endl;
- }
- }
+ onElementReceived(element);
}