diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-01-25 21:58:18 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-01-25 21:58:18 +0100 |
commit | 062b8889b884ba111012d16fc9e6094657ab1388 (patch) | |
tree | 3b78ee93ad0eaf98bde95d5863189d3a799e4be5 /src/main/java/de/pixart/messenger/entities | |
parent | 2bca57e773d773c56bd9788be12759ad4976815a (diff) |
check if encrypted pgp file get deleted
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Conversation.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index 73e2786dc..c375aafa1 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -193,20 +193,6 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl } } - public void findMessagesWithFiles(final OnMessageFound onMessageFound) { - final ArrayList<Message> results = new ArrayList<>(); - synchronized (this.messages) { - for (final Message m : this.messages) { - if (m.isFileOrImage() && m.getEncryption() != Message.ENCRYPTION_PGP) { - results.add(m); - } - } - } - for (Message result : results) { - onMessageFound.onMessageFound(result); - } - } - public void findFailedMessagesWithFiles(final OnMessageFound onMessageFound) { final ArrayList<Message> results = new ArrayList<>(); synchronized (this.messages) { @@ -252,11 +238,15 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl public boolean markAsDeleted(final List<String> uuids) { boolean deleted = false; + final PgpDecryptionService pgpDecryptionService = account.getPgpDecryptionService(); synchronized (this.messages) { - for(Message message : this.messages) { + for (Message message : this.messages) { if (uuids.contains(message.getUuid())) { message.setFileDeleted(true); deleted = true; + if (message.getEncryption() == Message.ENCRYPTION_PGP && pgpDecryptionService != null) { + pgpDecryptionService.discard(message); + } } } } |