From b38fe1e8f0a9a1aa479b4a61f65f61ae78db6665 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 11 Nov 2018 13:51:15 +0100 Subject: implement message deletion fixed #208 --- .../java/de/pixart/messenger/entities/Conversation.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/main/java/de/pixart/messenger/entities/Conversation.java') diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 1e5224489..db6006ca3 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -222,6 +222,20 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } } + public void findDeletedMessages(final OnMessageFound onMessageFound) { + final ArrayList results = new ArrayList<>(); + synchronized (this.messages) { + for (final Message m : this.messages) { + if (m.isDeleted()) { + results.add(m); + } + } + } + for (Message result : results) { + onMessageFound.onMessageFound(result); + } + } + public Message findMessageWithFileAndUuid(final String uuid) { synchronized (this.messages) { for (final Message message : this.messages) { -- cgit v1.2.3