summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-05-17 19:05:30 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-05-26 12:39:30 (GMT)
commitcf90536b5b015289ce8834b5417ba0fc7636cee6 (patch)
treef77913347956c909b984af1e21a249ff30c7c714 /Swift/Controllers/Chat/ChatControllerBase.cpp
parenta8caa2699330277b7b4aa69bfb4d3d2a08e71488 (diff)
downloadswift-cf90536b5b015289ce8834b5417ba0fc7636cee6.zip
swift-cf90536b5b015289ce8834b5417ba0fc7636cee6.tar.bz2
Fix MUC invitation request being overwritten by presence change
After an initial presence change, when a client received a MUC invite, a potential following offline presence could replace the previous MUC invite request in the chat view. This commit fixes the issue. Test-Information: Added unit test verifying the new behavior. Verified absence of described bug in Swift GUI. All tests pass on OS X 10.11.5. Change-Id: I8fd9c7ad3f5f5009f48fc3d86017cd94e1998f01
Diffstat (limited to 'Swift/Controllers/Chat/ChatControllerBase.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp
index 15f6112..a54c89e 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.cpp
+++ b/Swift/Controllers/Chat/ChatControllerBase.cpp
@@ -97,6 +97,7 @@ void ChatControllerBase::handleDayChangeTick() {
dateChangeTimer_->stop();
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(str(format(QT_TRANSLATE_NOOP("", "The day is now %1%")) % std::string(boost::posix_time::to_iso_extended_string(now)).substr(0,10))), ChatWindow::DefaultDirection);
+ lastWasPresence_ = false;
dayTicked();
createDayChangeTimer();
}
@@ -382,6 +383,7 @@ void ChatControllerBase::handleGeneralMUCInvitation(MUCInviteEvent::ref event) {
updateMessageCount();
chatWindow_->addMUCInvitation(senderDisplayNameFromMessage(event->getInviter()), event->getRoomJID(), event->getReason(), event->getPassword(), event->getDirect(), event->getImpromptu());
eventController_->handleIncomingEvent(event);
+ lastWasPresence_ = false;
}
void ChatControllerBase::handleMUCInvitation(Message::ref message) {