summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index b0aef95..da96603 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -628,7 +628,15 @@ void ChatsManager::handleIncomingMessage(boost::shared_ptr<Message> message) {
}
//if not a mucroom
- getChatControllerOrCreate(jid)->handleIncomingMessage(event);
+ if (!event->isReadable() && !isInvite && !isMediatedInvite) {
+ /* Only route such messages if a window exists, don't open new windows for them.*/
+ ChatController* controller = getChatControllerIfExists(jid);
+ if (controller) {
+ controller->handleIncomingMessage(event);
+ }
+ } else {
+ getChatControllerOrCreate(jid)->handleIncomingMessage(event);
+ }
}
void ChatsManager::handleMUCSelectedAfterSearch(const JID& muc) {