diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-11-20 18:23:22 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-11-20 18:23:22 (GMT) |
commit | 059ace39c432a89845e245604af03f5f71e1da84 (patch) | |
tree | 0c756410892adac6be4640cec4391c26798459a7 /Swiften/Client/ClientSession.h | |
parent | cf8e2aca04c9a4021448f829e5b264dad25b28c8 (diff) | |
download | swift-contrib-059ace39c432a89845e245604af03f5f71e1da84.zip swift-contrib-059ace39c432a89845e245604af03f5f71e1da84.tar.bz2 |
Added ClientSessionTest.
Diffstat (limited to 'Swiften/Client/ClientSession.h')
-rw-r--r-- | Swiften/Client/ClientSession.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index 795a09e..f980a9e 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -42,9 +42,9 @@ namespace Swift { Error(Type type) : type(type) {} }; - ClientSession( - const JID& jid, - boost::shared_ptr<SessionStream>); + static boost::shared_ptr<ClientSession> create(const JID& jid, boost::shared_ptr<SessionStream> stream) { + return boost::shared_ptr<ClientSession>(new ClientSession(jid, stream)); + } State getState() const { return state; @@ -56,7 +56,17 @@ namespace Swift { void sendCredentials(const String& password); void sendElement(boost::shared_ptr<Element> element); + public: + boost::signal<void ()> onNeedCredentials; + boost::signal<void ()> onInitialized; + boost::signal<void (boost::shared_ptr<Swift::Error>)> onFinished; + boost::signal<void (boost::shared_ptr<Element>)> onElementReceived; + private: + ClientSession( + const JID& jid, + boost::shared_ptr<SessionStream>); + void finishSession(Error::Type error); void finishSession(boost::shared_ptr<Swift::Error> error); @@ -75,12 +85,6 @@ namespace Swift { bool checkState(State); - public: - boost::signal<void ()> onNeedCredentials; - boost::signal<void ()> onInitialized; - boost::signal<void (boost::shared_ptr<Swift::Error>)> onFinished; - boost::signal<void (boost::shared_ptr<Element>)> onElementReceived; - private: JID localJID; State state; |