diff options
Diffstat (limited to 'Swift/Controllers/SystemTrayController.cpp')
-rw-r--r-- | Swift/Controllers/SystemTrayController.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Swift/Controllers/SystemTrayController.cpp b/Swift/Controllers/SystemTrayController.cpp index 23a94fa..d3824c9 100644 --- a/Swift/Controllers/SystemTrayController.cpp +++ b/Swift/Controllers/SystemTrayController.cpp @@ -19,8 +19,16 @@ SystemTrayController::SystemTrayController(EventController* eventController, Sys eventController_->onEventQueueLengthChange.connect(boost::bind(&SystemTrayController::handleEventQueueLengthChange, this, _1)); } -void SystemTrayController::handleEventQueueLengthChange(int length) { - systemTray_->setUnreadMessages(length > 0); +void SystemTrayController::handleEventQueueLengthChange(int /*length*/) { + EventList events = eventController_->getEvents(); + bool found = false; + for (EventList::iterator it = events.begin(); it != events.end(); it++) { + if (boost::dynamic_pointer_cast<MessageEvent>(*it)) { + found = true; + break; + } + } + systemTray_->setUnreadMessages(found); } void SystemTrayController::setMyStatusType(StatusShow::Type type) { |