diff options
-rw-r--r-- | Swift/Controllers/MainController.cpp | 9 | ||||
-rw-r--r-- | Swiften/MUC/MUC.h | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index d94cadc..e030a31 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -380,6 +380,9 @@ void MainController::handleJoinMUCRequest(const JID &muc, const String &nick) { void MainController::handleIncomingMessage(boost::shared_ptr<Message> message) { JID jid = message->getFrom(); boost::shared_ptr<MessageEvent> event(new MessageEvent(message)); + if (!event->isReadable()) { + return; + } // Try to deliver it to a MUC if (message->getType() == Message::Groupchat || message->getType() == Message::Error) { @@ -396,11 +399,7 @@ void MainController::handleIncomingMessage(boost::shared_ptr<Message> message) { //if not a mucroom eventController_->handleIncomingEvent(event); - - // FIXME: This logic should go into a chat manager - if (event->isReadable()) { - getChatController(jid)->handleIncomingMessage(event); - } + getChatController(jid)->handleIncomingMessage(event); } void MainController::handleServerDiscoInfoResponse(boost::shared_ptr<DiscoInfo> info, const boost::optional<ErrorPayload>& error) { diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h index 2a327f4..c31f9ac 100644 --- a/Swiften/MUC/MUC.h +++ b/Swiften/MUC/MUC.h @@ -30,7 +30,6 @@ namespace Swift { public: boost::signal<void (JoinResult)> onJoinComplete; - boost::signal<void (boost::shared_ptr<Message>)> onMessageReceived; boost::signal<void (boost::shared_ptr<Presence>)> onOccupantPresenceChange; boost::signal<void (const MUCOccupant&)> onOccupantJoined; /**Occupant, type, and reason. */ |