aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/entities
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-01-27 12:43:19 +0100
committerChristian Schneppe <christian@pix-art.de>2019-01-27 12:43:19 +0100
commit30e6ac6324fa87d19b8e67252ceb5b2dddc2fd02 (patch)
tree5225b5ce8b6c991b7cf7dfb9dcc77baedc557f66 /src/main/java/de/pixart/messenger/entities
parent9fa86472deb7df5b03c72a5bd2a7a3f87bf03c36 (diff)
scan all files in case some files were previously marked as deleted by accident
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 523e02b77..22c363f3a 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -29,6 +29,7 @@ import de.pixart.messenger.Config;
import de.pixart.messenger.crypto.OmemoSetting;
import de.pixart.messenger.crypto.PgpDecryptionService;
import de.pixart.messenger.crypto.axolotl.AxolotlService;
+import de.pixart.messenger.persistance.DatabaseBackend;
import de.pixart.messenger.services.QuickConversationsService;
import de.pixart.messenger.utils.JidHelper;
import de.pixart.messenger.xmpp.chatstate.ChatState;
@@ -253,6 +254,25 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
return deleted;
}
+
+ public boolean markAsChanged(final List<DatabaseBackend.FilePathInfo> files) {
+ boolean changed = false;
+ final PgpDecryptionService pgpDecryptionService = account.getPgpDecryptionService();
+ synchronized (this.messages) {
+ for (Message message : this.messages) {
+ for (final DatabaseBackend.FilePathInfo file : files)
+ if (file.uuid.toString().equals(message.getUuid())) {
+ message.setFileDeleted(file.FileDeleted);
+ changed = true;
+ if (file.FileDeleted && message.getEncryption() == Message.ENCRYPTION_PGP && pgpDecryptionService != null) {
+ pgpDecryptionService.discard(message);
+ }
+ }
+ }
+ }
+ return changed;
+ }
+
public void clearMessages() {
synchronized (this.messages) {
this.messages.clear();