summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-11-30 13:53:53 (GMT)
committerTobias Markmann <tm@ayena.de>2015-12-17 21:36:37 (GMT)
commit60074cfedd4a10dbdec43c9c0bbc62d5a75279c5 (patch)
treefe1980d9d7ea826f7c72f90529586f134db4f911 /Swift/Controllers/UnitTest
parent02a5b5c7f263913bd3d9b6977a1c6935e90c97eb (diff)
downloadswift-60074cfedd4a10dbdec43c9c0bbc62d5a75279c5.zip
swift-60074cfedd4a10dbdec43c9c0bbc62d5a75279c5.tar.bz2
Do not consult presence oracle for MUC PM presence
Test-Information: Added unit test verifying the behavior. Verified with multiple Swift instances in a MUC room that for MUC PMs only the same full JID presence counts. Change-Id: I08148221be34c3548f18da634586c828fd60feff
Diffstat (limited to 'Swift/Controllers/UnitTest')
-rw-r--r--Swift/Controllers/UnitTest/MockChatWindow.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h
index c906bfd..ddb7e3e 100644
--- a/Swift/Controllers/UnitTest/MockChatWindow.h
+++ b/Swift/Controllers/UnitTest/MockChatWindow.h
@@ -29,12 +29,16 @@ namespace Swift {
return "id";
}
- virtual void addPresenceMessage(const ChatMessage& /*message*/, Direction /*direction*/) {}
+ virtual void addPresenceMessage(const ChatMessage& message, Direction /*direction*/) {
+ lastAddedPresence_ = message;
+ }
virtual void addErrorMessage(const ChatMessage& /*message*/) {}
virtual void replaceMessage(const ChatMessage& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/, const HighlightAction& /*highlight*/) {}
virtual void replaceWithAction(const ChatMessage& /*message*/, const std::string& /*id*/, const boost::posix_time::ptime& /*time*/, const HighlightAction& /*highlight*/) {}
- virtual void replaceLastMessage(const ChatMessage& /*message*/, const TimestampBehaviour /*timestampBehaviour*/) {}
+ virtual void replaceLastMessage(const ChatMessage& message, const TimestampBehaviour /*timestampBehaviour*/) {
+ lastReplacedMessage_ = message;
+ }
virtual void replaceSystemMessage(const ChatMessage& /*message*/, const std::string& /*id*/, const TimestampBehaviour /*timestampBehaviour*/) {}
// File transfer related stuff
@@ -82,7 +86,7 @@ namespace Swift {
virtual void showBookmarkWindow(const MUCBookmark& /*bookmark*/) {}
virtual void setBookmarkState(RoomBookmarkState) {}
- std::string bodyFromMessage(const ChatMessage& message) {
+ static std::string bodyFromMessage(const ChatMessage& message) {
boost::shared_ptr<ChatTextMessagePart> text;
foreach (boost::shared_ptr<ChatMessagePart> part, message.getParts()) {
if ((text = boost::dynamic_pointer_cast<ChatTextMessagePart>(part))) {
@@ -94,6 +98,8 @@ namespace Swift {
std::string name_;
std::string lastMessageBody_;
+ ChatMessage lastAddedPresence_;
+ ChatMessage lastReplacedMessage_;
std::vector<SecurityLabelsCatalog::Item> labels_;
bool labelsEnabled_;
SecurityLabelsCatalog::Item label_;