summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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) {