summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp9
1 files changed, 4 insertions, 5 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) {