From 9d0b490523df69c4c846b934c240dcea39df49aa Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 9 Jul 2011 20:44:46 +0100
Subject: Don't store the full JID for new ChatList entries


diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 12fec4f..5c0475d 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -211,11 +211,11 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const
 		if (controller) {
 			unreadCount = controller->getUnreadCount();
 		}
-
-		Presence::ref presence = presenceOracle_->getHighestPriorityPresence(jid.toBare());
+		JID bareishJID = mucRegistry_->isMUC(jid.toBare()) ? jid : jid.toBare();
+		Presence::ref presence = presenceOracle_->getHighestPriorityPresence(bareishJID);
 		StatusShow::Type type = presence ? presence->getShow() : StatusShow::None;
-		boost::filesystem::path avatarPath = avatarManager_ ? avatarManager_->getAvatarPath(jid) : boost::filesystem::path();
-		return ChatListWindow::Chat(jid, nickResolver_->jidToNick(jid), activity, unreadCount, type, avatarPath, false);
+		boost::filesystem::path avatarPath = avatarManager_ ? avatarManager_->getAvatarPath(bareishJID) : boost::filesystem::path();
+		return ChatListWindow::Chat(bareishJID, nickResolver_->jidToNick(bareishJID), activity, unreadCount, type, avatarPath, false);
 	}
 }
 
-- 
cgit v0.10.2-6-g49f6