From 8aed9641dd20a3375f8a443189c7ca6243cf9fc6 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 26 Dec 2009 23:07:49 +0000
Subject: Additional plumbing for chat rebinding.


diff --git a/Swift/Controllers/ChatControllerBase.h b/Swift/Controllers/ChatControllerBase.h
index 91b72a8..c780789 100644
--- a/Swift/Controllers/ChatControllerBase.h
+++ b/Swift/Controllers/ChatControllerBase.h
@@ -31,6 +31,7 @@ namespace Swift {
 			void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info);
 			void handleIncomingMessage(boost::shared_ptr<MessageEvent> message);
 			void setEnabled(bool enabled);
+			void setToJID(const JID& jid) {toJID_ = jid;};
 		protected:
 			ChatControllerBase(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager);
 
diff --git a/Swift/Controllers/ChatsManager.cpp b/Swift/Controllers/ChatsManager.cpp
index 2863a14..e64967c 100644
--- a/Swift/Controllers/ChatsManager.cpp
+++ b/Swift/Controllers/ChatsManager.cpp
@@ -116,6 +116,7 @@ ChatController* ChatsManager::getChatController(const JID &contact) {
 void ChatsManager::rebindControllerJID(const JID& from, const JID& to) {
 	chatControllers_[to] = chatControllers_[from];
 	chatControllers_.erase(from);
+	chatControllers_[to]->setToJID(to);
 }
 
 void ChatsManager::handleJoinMUCRequest(const JID &muc, const String &nick) {
-- 
cgit v0.10.2-6-g49f6