diff options
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index b9e2cf4..4f95d71 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -937,8 +937,18 @@ void ChatsManager::handleIncomingMessage(std::shared_ptr<Message> incomingMessag return; } - // Try to deliver it to a MUC - if (message->getType() == Message::Groupchat || message->getType() == Message::Error /*|| (isInvite && message->getType() == Message::Normal)*/) { + // Try to deliver MUC errors to a MUC PM window if a suitable window is open. + if (message->getType() == Message::Error) { + auto controller = getChatControllerIfExists(fromJID, messageCausesSessionBinding(message)); + if (controller) { + controller->handleIncomingMessage(event); + return; + } + } + + // Try to deliver it to a MUC. + if (message->getType() == Message::Groupchat || message->getType() == Message::Error) { + // Try to deliver it to a MUC room. std::map<JID, MUCController*>::iterator i = mucControllers_.find(fromJID.toBare()); if (i != mucControllers_.end()) { i->second->handleIncomingMessage(event); |