diff options
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 7 | ||||
-rw-r--r-- | Swift/Controllers/Chat/MUCController.cpp | 11 | ||||
-rw-r--r-- | Swift/Controllers/Chat/MUCController.h | 1 |
3 files changed, 14 insertions, 5 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 7430f69..ca0916d 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -143,13 +143,10 @@ bool ChatControllerBase::isFromContact(const JID& from) { } void ChatControllerBase::handleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) { - if (messageEvent->isReadable()) { + preHandleIncomingMessage(messageEvent); + if (messageEvent->isReadable() && !messageEvent->getConcluded()) { unreadMessages_.push_back(messageEvent); } - - - - preHandleIncomingMessage(messageEvent); boost::shared_ptr<Message> message = messageEvent->getStanza(); String body = message->getBody(); if (message->isError()) { diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp index e4c13af..156c6a2 100644 --- a/Swift/Controllers/Chat/MUCController.cpp +++ b/Swift/Controllers/Chat/MUCController.cpp @@ -53,6 +53,7 @@ MUCController::MUCController ( joined_ = false; lastWasPresence_ = false; shouldJoinOnReconnect_ = true; + doneGettingHistory_ = false; events_ = uiEventStream; roster_ = new Roster(false, true); @@ -96,6 +97,7 @@ void MUCController::rejoin() { if (parting_) { joined_ = false; parting_ = false; + doneGettingHistory_ = false; //FIXME: check for received activity if (lastActivity_ == boost::posix_time::not_a_date_time) { muc_->joinAs(nick_); @@ -256,6 +258,15 @@ void MUCController::preHandleIncomingMessage(boost::shared_ptr<MessageEvent> mes if (!message->getSubject().isEmpty() && message->getBody().isEmpty()) { chatWindow_->addSystemMessage("The room subject is now: " + message->getSubject()); + doneGettingHistory_ = true; + } + + if (!doneGettingHistory_ && !message->getPayload<Delay>()) { + doneGettingHistory_ = true; + } + + if (!doneGettingHistory_) { + messageEvent->conclude(); } } diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h index 374ad79..258b730 100644 --- a/Swift/Controllers/Chat/MUCController.h +++ b/Swift/Controllers/Chat/MUCController.h @@ -90,6 +90,7 @@ namespace Swift { bool joined_; bool lastWasPresence_; bool shouldJoinOnReconnect_; + bool doneGettingHistory_; boost::bsignals::scoped_connection avatarChangedConnection_; boost::shared_ptr<Timer> loginCheckTimer_; std::set<String> currentOccupants_; |