diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-02-17 09:51:23 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-02-17 09:51:23 (GMT) |
commit | 61c5b31de95673ef943a244dc7d3ea2f93ce30c8 (patch) | |
tree | 66df4c82af9e09474534cf4cae8e5317c9c5f712 /Swift/Controllers | |
parent | 6e44e49a3ad1579d494fb78852f9bbe58ffc11e2 (diff) | |
download | swift-61c5b31de95673ef943a244dc7d3ea2f93ce30c8.zip swift-61c5b31de95673ef943a244dc7d3ea2f93ce30c8.tar.bz2 |
Only allow non-readable messages to a chat window if they're chat states.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 9a72f1f..d7de515 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -8,6 +8,7 @@ #include "Swift/Controllers/EventController.h" #include "Swift/Controllers/Chat/MUCController.h" #include "Swiften/Presence/PresenceSender.h" +#include "Swiften/Elements/ChatState.h" namespace Swift { @@ -133,9 +134,9 @@ void ChatsManager::handleJoinMUCRequest(const JID &muc, const String &nick) { void ChatsManager::handleIncomingMessage(boost::shared_ptr<Message> message) { JID jid = message->getFrom(); boost::shared_ptr<MessageEvent> event(new MessageEvent(message)); - //if (!event->isReadable()) { - // return; - //} + if (!event->isReadable() && !message->getPayload<ChatState>()) { + return; + } // Try to deliver it to a MUC if (message->getType() == Message::Groupchat || message->getType() == Message::Error) { |