summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-10-13 16:14:26 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-01 11:19:59 (GMT)
commitee7c1b0ea8bd9483add1f8b06d5b6f745f1cfe27 (patch)
treea3d260f05c65b93f90d837788e8e97db73a0bade /Swiften/LinkLocal
parent0f0cde0cdff42db72df4307ed68dac62e8acb1f3 (diff)
downloadswift-contrib-ee7c1b0ea8bd9483add1f8b06d5b6f745f1cfe27.zip
swift-contrib-ee7c1b0ea8bd9483add1f8b06d5b6f745f1cfe27.tar.bz2
Refactored some degenerate stuff out of base Session.
Diffstat (limited to 'Swiften/LinkLocal')
-rw-r--r--Swiften/LinkLocal/IncomingLinkLocalSession.cpp9
-rw-r--r--Swiften/LinkLocal/IncomingLinkLocalSession.h8
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.cpp1
3 files changed, 16 insertions, 2 deletions
diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
index a1fb901..4c3a681 100644
--- a/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/IncomingLinkLocalSession.cpp
@@ -18,7 +18,8 @@ IncomingLinkLocalSession::IncomingLinkLocalSession(
boost::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers) :
- Session(connection, payloadParserFactories, payloadSerializers) {
+ Session(connection, payloadParserFactories, payloadSerializers),
+ initialized(false) {
setLocalJID(localJID);
}
@@ -52,5 +53,11 @@ void IncomingLinkLocalSession::handleElement(boost::shared_ptr<Element> element)
onElementReceived(element);
}
+void IncomingLinkLocalSession::setInitialized() {
+ initialized = true;
+ onSessionStarted();
+}
+
+
}
diff --git a/Swiften/LinkLocal/IncomingLinkLocalSession.h b/Swiften/LinkLocal/IncomingLinkLocalSession.h
index 2f1a45b..e3f0460 100644
--- a/Swiften/LinkLocal/IncomingLinkLocalSession.h
+++ b/Swiften/LinkLocal/IncomingLinkLocalSession.h
@@ -22,8 +22,16 @@ namespace Swift {
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers);
+ boost::signal<void ()> onSessionStarted;
+
private:
void handleElement(boost::shared_ptr<Element>);
void handleStreamStart(const ProtocolHeader&);
+ void setInitialized();
+ bool isInitialized() const {
+ return initialized;
+ }
+
+ bool initialized;
};
}
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
index 1c2fefb..7b71f82 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
@@ -31,7 +31,6 @@ void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) {
sendElement(stanza);
}
queuedElements_.clear();
- setInitialized();
}
void OutgoingLinkLocalSession::handleElement(boost::shared_ptr<Element> element) {