summaryrefslogtreecommitdiffstats
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
parentdb00adc9810377500e6ab27900b29496a0d05afe (diff)
downloadswift-5498152b4c9537742019dd45db72c88d7e3dc70c.zip
swift-5498152b4c9537742019dd45db72c88d7e3dc70c.tar.bz2
Avoid having unreadable events added to queue.
-rw-r--r--Swift/Controllers/MainController.cpp9
-rw-r--r--Swiften/MUC/MUC.h1
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. */