diff options
author | Tobias Markmann <tm@ayena.de> | 2016-05-17 19:05:30 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2016-05-26 12:39:30 (GMT) |
commit | cf90536b5b015289ce8834b5417ba0fc7636cee6 (patch) | |
tree | f77913347956c909b984af1e21a249ff30c7c714 /Swift/Controllers/UnitTest | |
parent | a8caa2699330277b7b4aa69bfb4d3d2a08e71488 (diff) | |
download | swift-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/UnitTest')
-rw-r--r-- | Swift/Controllers/UnitTest/MockChatWindow.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h index f9b183d..4f874e1 100644 --- a/Swift/Controllers/UnitTest/MockChatWindow.h +++ b/Swift/Controllers/UnitTest/MockChatWindow.h @@ -43,7 +43,9 @@ namespace Swift { virtual void replaceLastMessage(const ChatMessage& message, const TimestampBehaviour /*timestampBehaviour*/) { lastReplacedMessage_ = message; } - virtual void replaceSystemMessage(const ChatMessage& /*message*/, const std::string& /*id*/, const TimestampBehaviour /*timestampBehaviour*/) {} + virtual void replaceSystemMessage(const ChatMessage& message, const std::string& /*id*/, const TimestampBehaviour /*timestampBehaviour*/) { + lastReplacedSystemMessage_ = message; + } // File transfer related stuff virtual std::string addFileTransfer(const std::string& /*senderName*/, bool /*senderIsSelf*/,const std::string& /*filename*/, const boost::uintmax_t /*sizeInBytes*/, const std::string& /*description*/) { return nullptr; } @@ -77,7 +79,9 @@ namespace Swift { void setAvailableOccupantActions(const std::vector<OccupantAction>&/* actions*/) {} void setSubject(const std::string& /*subject*/) {} virtual void showRoomConfigurationForm(Form::ref) {} - virtual void addMUCInvitation(const std::string& /*senderName*/, const JID& /*jid*/, const std::string& /*reason*/, const std::string& /*password*/, bool = true, bool = false, bool = false) {} + virtual void addMUCInvitation(const std::string& /*senderName*/, const JID& jid, const std::string& /*reason*/, const std::string& /*password*/, bool = true, bool = false, bool = false) { + lastMUCInvitationJID_ = jid; + } virtual std::string addWhiteboardRequest(bool) {return "";} virtual void setWhiteboardSessionStatus(std::string, const ChatWindow::WhiteboardSessionState){} @@ -109,7 +113,7 @@ namespace Swift { } void resetLastMessages() { - lastAddedMessage_ = lastAddedAction_ = lastAddedPresence_ = lastReplacedMessage_ = lastAddedSystemMessage_ = ChatMessage(); + lastAddedMessage_ = lastAddedAction_ = lastAddedPresence_ = lastReplacedMessage_ = lastAddedSystemMessage_ = lastReplacedSystemMessage_ = ChatMessage(); } std::string name_; @@ -118,6 +122,8 @@ namespace Swift { ChatMessage lastAddedPresence_; ChatMessage lastReplacedMessage_; ChatMessage lastAddedSystemMessage_; + ChatMessage lastReplacedSystemMessage_; + JID lastMUCInvitationJID_; std::vector<SecurityLabelsCatalog::Item> labels_; bool labelsEnabled_; bool impromptuMUCSupported_; |