summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/BasicSessionStream.cpp6
-rw-r--r--Swiften/Session/BasicSessionStream.h1
-rw-r--r--Swiften/Session/SessionStream.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp
index 402f642..10c6ad0 100644
--- a/Swiften/Session/BasicSessionStream.cpp
+++ b/Swiften/Session/BasicSessionStream.cpp
@@ -40,6 +40,7 @@ BasicSessionStream::BasicSessionStream(
tlsOptions_(tlsOptions) {
xmppLayer = new XMPPLayer(payloadParserFactories, payloadSerializers, xmlParserFactory, streamType);
xmppLayer->onStreamStart.connect(boost::bind(&BasicSessionStream::handleStreamStartReceived, this, _1));
+ xmppLayer->onStreamEnd.connect(boost::bind(&BasicSessionStream::handleStreamEndReceived, this));
xmppLayer->onElement.connect(boost::bind(&BasicSessionStream::handleElementReceived, this, _1));
xmppLayer->onError.connect(boost::bind(&BasicSessionStream::handleXMPPError, this));
xmppLayer->onDataRead.connect(boost::bind(&BasicSessionStream::handleDataRead, this, _1));
@@ -68,6 +69,7 @@ BasicSessionStream::~BasicSessionStream() {
delete connectionLayer;
xmppLayer->onStreamStart.disconnect(boost::bind(&BasicSessionStream::handleStreamStartReceived, this, _1));
+ xmppLayer->onStreamEnd.disconnect(boost::bind(&BasicSessionStream::handleStreamEndReceived, this));
xmppLayer->onElement.disconnect(boost::bind(&BasicSessionStream::handleElementReceived, this, _1));
xmppLayer->onError.disconnect(boost::bind(&BasicSessionStream::handleXMPPError, this));
xmppLayer->onDataRead.disconnect(boost::bind(&BasicSessionStream::handleDataRead, this, _1));
@@ -171,6 +173,10 @@ void BasicSessionStream::handleStreamStartReceived(const ProtocolHeader& header)
onStreamStartReceived(header);
}
+void BasicSessionStream::handleStreamEndReceived() {
+ onStreamEndReceived();
+}
+
void BasicSessionStream::handleElementReceived(std::shared_ptr<ToplevelElement> element) {
onElementReceived(element);
}
diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h
index 1806cef..48b3d63 100644
--- a/Swiften/Session/BasicSessionStream.h
+++ b/Swiften/Session/BasicSessionStream.h
@@ -73,6 +73,7 @@ namespace Swift {
void handleTLSConnected();
void handleTLSError(std::shared_ptr<TLSError>);
void handleStreamStartReceived(const ProtocolHeader&);
+ void handleStreamEndReceived();
void handleElementReceived(std::shared_ptr<ToplevelElement>);
void handleDataRead(const SafeByteArray& data);
void handleDataWritten(const SafeByteArray& data);
diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h
index f56f495..c5ec42a 100644
--- a/Swiften/Session/SessionStream.h
+++ b/Swiften/Session/SessionStream.h
@@ -75,6 +75,7 @@ namespace Swift {
virtual ByteArray getTLSFinishMessage() const = 0;
boost::signals2::signal<void (const ProtocolHeader&)> onStreamStartReceived;
+ boost::signals2::signal<void ()> onStreamEndReceived;
boost::signals2::signal<void (std::shared_ptr<ToplevelElement>)> onElementReceived;
boost::signals2::signal<void (std::shared_ptr<Error>)> onClosed;
boost::signals2::signal<void ()> onTLSEncrypted;