diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-07-08 07:57:03 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-07-08 07:57:03 (GMT) |
commit | 617aae78858ea50aa82cd9012f41c547057f5707 (patch) | |
tree | 4b55aeaf7146046f17ca8c5f0522beaafdd33a82 /Swift/Controllers/Chat/ChatsManager.cpp | |
parent | bd7a78529da15acb0698453d77324cdc8a02005f (diff) | |
download | swift-contrib-617aae78858ea50aa82cd9012f41c547057f5707.zip swift-contrib-617aae78858ea50aa82cd9012f41c547057f5707.tar.bz2 |
Cleaning up the unread chats
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 66817aa..cf31bde 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -135,7 +135,7 @@ void ChatsManager::loadRecents() { ChatListWindow::Chat chat(jid, nickResolver_->jidToNick(jid), activity, 0, isMUC, nick); prependRecent(chat); } - chatListWindow_->setRecents(recentChats_); + handleUnreadCountChanged(NULL); } void ChatsManager::setupBookmarks() { @@ -186,14 +186,14 @@ void ChatsManager::handleChatActivity(const JID& jid, const std::string& activit /* FIXME: handle nick changes */ appendRecent(chat); - chatListWindow_->setRecents(recentChats_); + handleUnreadCountChanged(NULL); saveRecents(); } void ChatsManager::handleUnreadCountChanged(ChatController* controller) { int unreadTotal = 0; foreach (ChatListWindow::Chat chatItem, recentChats_) { - if (chatItem.jid == controller->getToJID()) { + if (controller && chatItem.jid.toBare() == controller->getToJID().toBare()) { chatItem.setUnreadCount(controller->getUnreadCount()); } unreadTotal += chatItem.unreadCount; |