diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-10-04 16:41:06 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-10-04 16:45:49 (GMT) |
commit | 56498f72ef1fbba08ef48c0cd91867786977c4d1 (patch) | |
tree | 2c9a396c123a52a63248353afb2bb3d2555a23f7 | |
parent | 8520b85226d8486fe4069a3f5eb9cb340514866d (diff) | |
download | swift-56498f72ef1fbba08ef48c0cd91867786977c4d1.zip swift-56498f72ef1fbba08ef48c0cd91867786977c4d1.tar.bz2 |
Only bounce the dock (or flash the taskbar) on readable messages.
Resolves: #453
-rw-r--r-- | Swift/Controllers/Chat/ChatController.cpp | 4 | ||||
-rw-r--r-- | Swift/Controllers/Chat/MUCController.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp index 18076d8..924ca97 100644 --- a/Swift/Controllers/Chat/ChatController.cpp +++ b/Swift/Controllers/Chat/ChatController.cpp @@ -88,7 +88,9 @@ bool ChatController::isIncomingMessageFromMe(boost::shared_ptr<Message>) { void ChatController::preHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) { eventController_->handleIncomingEvent(messageEvent); - chatWindow_->flash(); + if (messageEvent->isReadable()) { + chatWindow_->flash(); + } boost::shared_ptr<Message> message = messageEvent->getStanza(); JID from = message->getFrom(); if (!from.equals(toJID_, JID::WithResource)) { diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp index 064c87e..c4b4086 100644 --- a/Swift/Controllers/Chat/MUCController.cpp +++ b/Swift/Controllers/Chat/MUCController.cpp @@ -229,7 +229,9 @@ void MUCController::preHandleIncomingMessage(boost::shared_ptr<MessageEvent> mes boost::shared_ptr<Message> message = messageEvent->getStanza(); if (joined_ && messageTargetsMe(message) && !message->getPayload<Delay>()) { eventController_->handleIncomingEvent(messageEvent); - chatWindow_->flash(); + if (messageEvent->isReadable()) { + chatWindow_->flash(); + } } if (joined_) { String nick = message->getFrom().getResource(); |