diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-02-16 09:05:37 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-02-17 08:05:08 (GMT) |
commit | 5a334fd9b676564a8915baad312d92bd86358eec (patch) | |
tree | aaecbbccd9cddcb843c126b8c022f1d1e667efde /Swift/Controllers/Chat/ChatControllerBase.cpp | |
parent | 231c2cb6d00061e70860626467107f4c63f359a0 (diff) | |
download | swift-contrib-5a334fd9b676564a8915baad312d92bd86358eec.zip swift-contrib-5a334fd9b676564a8915baad312d92bd86358eec.tar.bz2 |
Preliminary Chat State Notifications support.
Only covers Active and Composing (Which is very possibly all we care about).
Diffstat (limited to 'Swift/Controllers/Chat/ChatControllerBase.cpp')
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 5f78795..6fe50d3 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -98,7 +98,9 @@ void ChatControllerBase::addMessage(const String& message, const String& senderN } void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) { - unreadMessages_.push_back(messageEvent); + if (messageEvent->isReadable()) { + unreadMessages_.push_back(messageEvent); + } chatWindow_->setUnreadMessageCount(unreadMessages_.size()); boost::shared_ptr<Message> message = messageEvent->getStanza(); @@ -109,6 +111,9 @@ void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> m chatWindow_->addErrorMessage(errorMessage); } else { + if (!messageEvent->isReadable()) { + return; + } showChatWindow(); boost::shared_ptr<SecurityLabel> label = message->getPayload<SecurityLabel>(); boost::optional<SecurityLabel> maybeLabel = label ? boost::optional<SecurityLabel>(*label) : boost::optional<SecurityLabel>(); |