summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp9
-rw-r--r--Swiften/Server/ServerFromClientSession.h8
2 files changed, 16 insertions, 1 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index 3efacd7..c974e18 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -26,7 +26,8 @@ ServerFromClientSession::ServerFromClientSession(
Session(connection, payloadParserFactories, payloadSerializers),
id_(id),
userRegistry_(userRegistry),
- authenticated_(false) {
+ authenticated_(false),
+ initialized(false) {
}
@@ -87,4 +88,10 @@ void ServerFromClientSession::handleStreamStart(const ProtocolHeader& incomingHe
getXMPPLayer()->writeElement(features);
}
+void ServerFromClientSession::setInitialized() {
+ initialized = true;
+ onSessionStarted();
+}
+
+
}
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index 748f7eb..33826a4 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -31,14 +31,22 @@ namespace Swift {
PayloadSerializerCollection* payloadSerializers,
UserRegistry* userRegistry);
+ boost::signal<void ()> onSessionStarted;
+
private:
void handleElement(boost::shared_ptr<Element>);
void handleStreamStart(const ProtocolHeader& header);
+ void setInitialized();
+ bool isInitialized() const {
+ return initialized;
+ }
+
private:
String id_;
UserRegistry* userRegistry_;
bool authenticated_;
+ bool initialized;
String user_;
};
}