diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-07-21 10:07:49 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-07-21 10:07:49 (GMT) |
commit | abd4d8981ebc5ad579102002483f410a5d4d79da (patch) | |
tree | ddf347f77653c64d81e8e087f34d1243c6b68d0d /Slimber/Server.cpp | |
parent | abba8740ba29f05eef23a826e3095214f51bd0a4 (diff) | |
download | swift-contrib-abd4d8981ebc5ad579102002483f410a5d4d79da.zip swift-contrib-abd4d8981ebc5ad579102002483f410a5d4d79da.tar.bz2 |
Update the "You are logged in" menu.
Diffstat (limited to 'Slimber/Server.cpp')
-rw-r--r-- | Slimber/Server.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index e84659a..1922351 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -53,9 +53,10 @@ void Server::handleNewClientConnection(boost::shared_ptr<Connection> c) { c->disconnect(); } serverFromClientSession_ = boost::shared_ptr<ServerFromClientSession>(new ServerFromClientSession(idGenerator_.generateID(), c, &payloadParserFactories_, &payloadSerializers_, &userRegistry_)); + serverFromClientSession_->onSessionStarted.connect(boost::bind(&Server::handleSessionStarted, this)); serverFromClientSession_->onElementReceived.connect(boost::bind(&Server::handleElementReceived, this, _1, serverFromClientSession_)); serverFromClientSession_->onSessionFinished.connect(boost::bind(&Server::handleSessionFinished, this, serverFromClientSession_)); - tracers_.push_back(boost::shared_ptr<SessionTracer>(new SessionTracer(serverFromClientSession_))); + //tracers_.push_back(boost::shared_ptr<SessionTracer>(new SessionTracer(serverFromClientSession_))); serverFromClientSession_->startSession(); } @@ -72,11 +73,16 @@ void Server::handleServiceRegistered(const DNSSDService::Service& service) { selfJID_ = JID(service.name); } +void Server::handleSessionStarted() { + onSelfConnected(true); +} + void Server::handleSessionFinished(boost::shared_ptr<ServerFromClientSession>) { serverFromClientSession_.reset(); unregisterService(); selfJID_ = JID(); rosterRequested_ = false; + onSelfConnected(false); } void Server::handleLinkLocalSessionFinished(boost::shared_ptr<Session> session) { @@ -214,7 +220,7 @@ void Server::registerLinkLocalSession(boost::shared_ptr<Session> session) { session->onSessionFinished.connect(boost::bind(&Server::handleLinkLocalSessionFinished, this, session)); session->onElementReceived.connect(boost::bind(&Server::handleLinkLocalElementReceived, this, _1, session)); linkLocalSessions_.push_back(session); - tracers_.push_back(boost::shared_ptr<SessionTracer>(new SessionTracer(session))); + //tracers_.push_back(boost::shared_ptr<SessionTracer>(new SessionTracer(session))); session->startSession(); } |