From 1db3724bd248d98e877f0be1485ef54b3ce503a7 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Tue, 26 Jan 2016 16:04:00 +0100
Subject: Fix MUC nickname change error in ChatController

ChatControllers used to wrongly lookup the nickname of a MUC
PM contact using the bare room JID after a nickname change.
With this change, the new full JID, i.e. with the new nickname
as resource part, is used for nickname lookup.

Test-Information:

Tested with multiple PM chats open in a room. Both PM contacts
changing their nicknames. Now only the corresponding chat tab
changes its title. Before both used to change their title on
a change of a single occupants nickname.

./scons test=system passes on OS X 10.11.3.

Change-Id: I1c274498bcd96edd3370f73cb824fc81d726682c

diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp
index e2751f7..eb86766 100644
--- a/Swift/Controllers/Chat/ChatController.cpp
+++ b/Swift/Controllers/Chat/ChatController.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
  * All rights reserved.
  * See the COPYING file for more information.
  */
@@ -106,7 +106,7 @@ ChatController::ChatController(const JID& self, StanzaChannel* stanzaChannel, IQ
 
 void ChatController::handleContactNickChanged(const JID& jid, const std::string& /*oldNick*/) {
 	if (jid.toBare() == toJID_.toBare()) {
-		chatWindow_->setName(nickResolver_->jidToNick(jid));
+		chatWindow_->setName(nickResolver_->jidToNick(toJID_));
 	}
 }
 
-- 
cgit v0.10.2-6-g49f6