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/Server
parent0f0cde0cdff42db72df4307ed68dac62e8acb1f3 (diff)
downloadswift-contrib-ee7c1b0ea8bd9483add1f8b06d5b6f745f1cfe27.zip
swift-contrib-ee7c1b0ea8bd9483add1f8b06d5b6f745f1cfe27.tar.bz2
Refactored some degenerate stuff out of base Session.
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_;
};
}