summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-05-09 09:22:29 (GMT)
committerTobias Markmann <tm@ayena.de>2016-07-11 18:34:34 (GMT)
commitd508ac6ac41918d2c831b47b29761980989dd7f6 (patch)
tree3a93dd6f93727a4d74fbafb4ca0912bbe64e7a87 /Swift/Controllers/UnitTest
parentbcd1c925eb2ef4af0f759366d7c5476cfc670366 (diff)
downloadswift-d508ac6ac41918d2c831b47b29761980989dd7f6.zip
swift-d508ac6ac41918d2c831b47b29761980989dd7f6.tar.bz2
Fix handling of incorrect MUC component behavior
Swift used to crash when a MUC component returned multiple unavailable presences on rejoin of a room hosted on a restarting buggy MUC component. Test-Information: Added test case that used to crash Swift. Tests pass without crash on OS X 10.11.4 Change-Id: I52280976944170c6e143197d4b3dc517dc13ecbb
Diffstat (limited to 'Swift/Controllers/UnitTest')
-rw-r--r--Swift/Controllers/UnitTest/MockChatWindow.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h
index d7942ff..054cd31 100644
--- a/Swift/Controllers/UnitTest/MockChatWindow.h
+++ b/Swift/Controllers/UnitTest/MockChatWindow.h
@@ -40,7 +40,9 @@ namespace Swift {
lastAddedPresence_ = message;
}
- virtual void addErrorMessage(const ChatMessage& /*message*/) {}
+ virtual void addErrorMessage(const ChatMessage& message) {
+ lastAddedErrorMessage_ = message;
+ }
virtual void replaceMessage(const ChatMessage& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/) {}
virtual void replaceWithAction(const ChatMessage& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/) {}
virtual void replaceLastMessage(const ChatMessage& message, const TimestampBehaviour /*timestampBehaviour*/) {
@@ -134,6 +136,7 @@ namespace Swift {
ChatMessage lastReplacedMessage_;
ChatMessage lastAddedSystemMessage_;
ChatMessage lastReplacedSystemMessage_;
+ ChatMessage lastAddedErrorMessage_;
JID lastMUCInvitationJID_;
std::vector<SecurityLabelsCatalog::Item> labels_;
bool labelsEnabled_;