diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-12-10 20:58:42 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-12-10 20:58:42 +0100 |
commit | 98feed20922473799a55a3356907878407e58597 (patch) | |
tree | 4acf9d699e549b9bc33352a775eff1b2ad260180 /src/main/java/de/pixart/messenger/entities | |
parent | a67ae91d9fefd829408cc62e25514fa38c8762e6 (diff) |
MAM: update previously sent messages with server msg id during mam query
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 030cf9664..3df78fde0 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -839,15 +839,19 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl return this.bookmark; } - public boolean hasDuplicateMessage(Message message) { + public Message findDuplicateMessage(Message message) { synchronized (this.messages) { for (int i = this.messages.size() - 1; i >= 0; --i) { if (this.messages.get(i).similar(message)) { - return true; + return this.messages.get(i); } } } - return false; + return null; + } + + public boolean hasDuplicateMessage(Message message) { + return findDuplicateMessage(message) != null; } public Message findSentMessageWithBody(String body) { |