diff options
author | HanzZ <hanzz.k@gmail.com> | 2011-06-18 18:47:50 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-06-19 17:48:53 (GMT) |
commit | 86844bd1818c389d471977303121b03fe15e992a (patch) | |
tree | bbef2d017067bad6a346636ccca849a3f430dbac | |
parent | 62afc432fa7ba9ac06409e27676cd41480dcf3b8 (diff) | |
download | swift-86844bd1818c389d471977303121b03fe15e992a.zip swift-86844bd1818c389d471977303121b03fe15e992a.tar.bz2 |
Send footer when finishing session
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
-rw-r--r-- | Swiften/Session/Session.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Swiften/Session/Session.cpp b/Swiften/Session/Session.cpp index 39fab14..cdb83d4 100644 --- a/Swiften/Session/Session.cpp +++ b/Swiften/Session/Session.cpp @@ -38,18 +38,26 @@ void Session::startSession() { } void Session::finishSession() { + if (finishing) + return; finishing = true; + if (xmppLayer) { + xmppLayer->writeFooter(); + } connection->disconnect(); handleSessionFinished(boost::optional<SessionError>()); - finishing = false; onSessionFinished(boost::optional<SessionError>()); } void Session::finishSession(const SessionError& error) { + if (finishing) + return; finishing = true; + if (xmppLayer) { + xmppLayer->writeFooter(); + } connection->disconnect(); handleSessionFinished(boost::optional<SessionError>(error)); - finishing = false; onSessionFinished(boost::optional<SessionError>(error)); } |