From cd0f776a351462339315fee2329a2d4037602dbe Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 26 Jul 2016 20:43:05 +0200 Subject: added more logging for file deletion --- .../conversations/services/XmppConnectionService.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index c349d20cb..93fa4cf44 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1283,18 +1283,23 @@ public class XmppConnectionService extends Service { } private void markFileDeleted(final String path) { + Log.d(Config.LOGTAG,"deleted file "+path); for (Conversation conversation : getConversations()) { conversation.findMessagesWithFiles(new Conversation.OnMessageFound() { @Override public void onMessageFound(Message message) { DownloadableFile file = fileBackend.getFile(message); - if (file.getAbsolutePath().equals(path) && !file.exists()) { - message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED)); - final int s = message.getStatus(); - if (s == Message.STATUS_WAITING || s == Message.STATUS_OFFERED || s == Message.STATUS_UNSEND) { - markMessage(message, Message.STATUS_SEND_FAILED); + if (file.getAbsolutePath().equals(path)) { + if (file.exists()) { + message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED)); + final int s = message.getStatus(); + if (s == Message.STATUS_WAITING || s == Message.STATUS_OFFERED || s == Message.STATUS_UNSEND) { + markMessage(message, Message.STATUS_SEND_FAILED); + } else { + updateConversationUi(); + } } else { - updateConversationUi(); + Log.d(Config.LOGTAG,"found matching message for file "+path+" but file still exists"); } } } -- cgit v1.2.3