summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2017-04-03 14:02:33 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-04-10 08:54:25 (GMT)
commitebd98c32281e2c2689480357f7e8ce6084e16384 (patch)
tree6e14aaf6211a79966edfe3e4536d6bb899a9eeeb /Swift/Controllers/Chat/ChatControllerBase.h
parent0b4c4ade26c7ff77ba7f8b4ae83e4bd3581bf345 (diff)
downloadswift-ebd98c32281e2c2689480357f7e8ce6084e16384.zip
swift-ebd98c32281e2c2689480357f7e8ce6084e16384.tar.bz2
Ignore incoming duplicates of messages
This might happen with some servers and their MUC implementation which send you not only the original message but also multiple carbon copies of it for MUC PM conversations. This change will ignore any message that has the same non-empty message ID as the previously incoming message. Test-Information: Added unit test to verify new behaviour. Tested in a MUC where the server would send you the original message and multiple carbon copies of the message. Previously the chat view would show and incoming MUC PM message 4 times. Now it’s only shown once. Builds and tests pass on macOS 10.12.4. Change-Id: Ie7bd29dacc00f8f3962131a529b52a69ff09bd6c
Diffstat (limited to 'Swift/Controllers/Chat/ChatControllerBase.h')
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Swift/Controllers/Chat/ChatControllerBase.h b/Swift/Controllers/Chat/ChatControllerBase.h
index 5ddda52..c84c4d4 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.h
+++ b/Swift/Controllers/Chat/ChatControllerBase.h
@@ -97,6 +97,9 @@ namespace Swift {
virtual void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming) = 0;
ChatWindow::ChatMessage buildChatWindowChatMessage(const std::string& message, const std::string& senderName, bool senderIsSelf);
void updateMessageCount();
+ virtual bool shouldIgnoreMessage(std::shared_ptr<Message> /* message */) {
+ return false;
+ }
private:
IDGenerator idGenerator_;