From 431eb62386101dc8fc1e7d346c49bd0d81fda70e Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Fri, 12 Feb 2016 21:19:23 +0100
Subject: Fix file-transfer UI replace after presence change glitch

Forgot to reset the lastWasPresence_ flag when file-transfer
UI is added to a chat view. The flag is used to amend the
existing presence change log in a chat view in case of
consecutive presence changes.

Test-Information:

Transfer a file to a Swift user and go offline afterwards.
Without this patch the file-transfer UI is replaced by
a presence change message. With this patch a new presence
change message is added instead.

Change-Id: I54a5cfd398bd4ba79eb15a1b14b08db3377233a4

diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp
index 11ba89e..6e540eb 100644
--- a/Swift/Controllers/Chat/ChatController.cpp
+++ b/Swift/Controllers/Chat/ChatController.cpp
@@ -6,8 +6,6 @@
 
 #include <Swift/Controllers/Chat/ChatController.h>
 
-#include <stdio.h>
-
 #include <boost/bind.hpp>
 #include <boost/smart_ptr/make_shared.hpp>
 
@@ -364,8 +362,8 @@ void ChatController::setOnline(bool online) {
 void ChatController::handleNewFileTransferController(FileTransferController* ftc) {
 	std::string nick = senderDisplayNameFromMessage(ftc->getOtherParty());
 	std::string ftID = ftc->setChatWindow(chatWindow_, nick);
-	
 	ftControllers[ftID] = ftc;
+	lastWasPresence_ = false;
 }
 
 void ChatController::handleWhiteboardSessionRequest(bool senderIsSelf) {
-- 
cgit v0.10.2-6-g49f6