diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-08-29 15:20:29 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-08-29 17:32:41 (GMT) |
commit | 46b13c4d25270c6933d20c6aa790619e30e4cfe8 (patch) | |
tree | 36fb78a6eb49180ddbffe2d50e5034f89474e72e /Swiften/Client/ClientSession.h | |
parent | f2301a18167bc1221cc0b70b71692ce9d1021119 (diff) | |
download | swift-contrib-46b13c4d25270c6933d20c6aa790619e30e4cfe8.zip swift-contrib-46b13c4d25270c6933d20c6aa790619e30e4cfe8.tar.bz2 |
Added stanza acking support to client.
Diffstat (limited to 'Swiften/Client/ClientSession.h')
-rw-r--r-- | Swiften/Client/ClientSession.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index 936fd18..c15508a 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -16,6 +16,8 @@ #include "Swiften/Base/String.h" #include "Swiften/JID/JID.h" #include "Swiften/Elements/Element.h" +#include "Swiften/StreamManagement/StanzaAckRequester.h" +#include "Swiften/StreamManagement/StanzaAckResponder.h" namespace Swift { class ClientAuthenticator; @@ -31,6 +33,7 @@ namespace Swift { Encrypting, WaitingForCredentials, Authenticating, + EnablingSessionManagement, BindingResource, StartingSession, Initialized, @@ -65,17 +68,22 @@ namespace Swift { allowPLAINOverNonTLS = b; } + bool getStreamManagementEnabled() const { + return stanzaAckRequester_; + } + void start(); void finish(); void sendCredentials(const String& password); - void sendElement(boost::shared_ptr<Element> element); + void sendStanza(boost::shared_ptr<Stanza>); 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; + boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaReceived; + boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaAcked; private: ClientSession( @@ -90,7 +98,6 @@ namespace Swift { } void sendStreamHeader(); - void sendSessionStart(); void handleElement(boost::shared_ptr<Element>); void handleStreamStart(const ProtocolHeader&); @@ -99,6 +106,11 @@ namespace Swift { void handleTLSEncrypted(); bool checkState(State); + void continueSessionInitialization(); + + void requestAck(); + void handleStanzaAcked(boost::shared_ptr<Stanza> stanza); + void ack(unsigned int handledStanzasCount); private: JID localJID; @@ -106,6 +118,9 @@ namespace Swift { boost::shared_ptr<SessionStream> stream; bool allowPLAINOverNonTLS; bool needSessionStart; + bool needResourceBind; ClientAuthenticator* authenticator; + boost::shared_ptr<StanzaAckRequester> stanzaAckRequester_; + boost::shared_ptr<StanzaAckResponder> stanzaAckResponder_; }; } |