summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-25 21:34:08 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-25 21:34:08 (GMT)
commit5498152b4c9537742019dd45db72c88d7e3dc70c (patch)
tree94e7df9db7bd731eb342f05e200731b73319a176 /Swift
parentdb00adc9810377500e6ab27900b29496a0d05afe (diff)
downloadswift-contrib-5498152b4c9537742019dd45db72c88d7e3dc70c.zip
swift-contrib-5498152b4c9537742019dd45db72c88d7e3dc70c.tar.bz2
Avoid having unreadable events added to queue.
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) {