summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp6
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;