aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index cf867d796..b20e57e3f 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -146,7 +146,6 @@ public class HttpDownloadConnection implements Transferable {
}
private void finish() {
- mXmppConnectionService.getFileBackend().updateMediaScanner(file);
message.setTransferable(null);
mHttpConnectionManager.finishConnection(this);
boolean notify = acceptedAutomatically && !message.isRead();
@@ -154,9 +153,12 @@ public class HttpDownloadConnection implements Transferable {
notify = message.getConversation().getAccount().getPgpDecryptionService().decrypt(message, notify);
}
mHttpConnectionManager.updateConversationUi(true);
- if (notify) {
- mXmppConnectionService.getNotificationService().push(message);
- }
+ final boolean notifyAfterScan = notify;
+ mXmppConnectionService.getFileBackend().updateMediaScanner(file, () -> {
+ if (notifyAfterScan) {
+ mXmppConnectionService.getNotificationService().push(message);
+ }
+ });
}
private void changeStatus(int status) {