summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-19 17:51:46 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-19 17:51:46 (GMT)
commit499ec820b7b92d9f9a84569fdbc31507f462a77d (patch)
treea3b13a28e6513939550005b1b4cfb0eb6f618cf3 /Swiften
parentd4a48f83e856b380f6bf19eb19ea0b80ceef20ab (diff)
parente61e188ade3a42f7fd5ef4d6e5673d55e99a51f6 (diff)
downloadswift-499ec820b7b92d9f9a84569fdbc31507f462a77d.zip
swift-499ec820b7b92d9f9a84569fdbc31507f462a77d.tar.bz2
Merge branch 'swift-1.x'
* swift-1.x: Small tweak to previous patch. Send footer when finishing session
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Session/Session.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Swiften/Session/Session.cpp b/Swiften/Session/Session.cpp
index 1d78640..e8b8308 100644
--- a/Swiften/Session/Session.cpp
+++ b/Swiften/Session/Session.cpp
@@ -38,18 +38,28 @@ 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));
}