summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanzZ <hanzz.k@gmail.com>2011-06-18 18:47:50 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-19 17:48:53 (GMT)
commit86844bd1818c389d471977303121b03fe15e992a (patch)
treebbef2d017067bad6a346636ccca849a3f430dbac /Swiften/Session
parent62afc432fa7ba9ac06409e27676cd41480dcf3b8 (diff)
downloadswift-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
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/Session.cpp12
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));
}