diff options
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 802a7cb..df59c2f 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -90,12 +90,14 @@ void ChatControllerBase::setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> } void ChatControllerBase::handleAllMessagesRead() { - foreach (boost::shared_ptr<MessageEvent> messageEvent, unreadMessages_) { - messageEvent->read(); + if (!unreadMessages_.empty()) { + foreach (boost::shared_ptr<MessageEvent> messageEvent, unreadMessages_) { + messageEvent->read(); + } + unreadMessages_.clear(); + chatWindow_->setUnreadMessageCount(0); + onUnreadCountChanged(); } - unreadMessages_.clear(); - chatWindow_->setUnreadMessageCount(0); - onUnreadCountChanged(); } int ChatControllerBase::getUnreadCount() { |