added more logging for file deletion

This commit is contained in:
Daniel Gultsch 2016-07-26 20:43:05 +02:00
parent 3409399ef1
commit 82908fb54b
1 changed files with 11 additions and 6 deletions

View File

@ -1287,12 +1287,14 @@ 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()) {
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) {
@ -1300,6 +1302,9 @@ public class XmppConnectionService extends Service {
} else {
updateConversationUi();
}
} else {
Log.d(Config.LOGTAG,"found matching message for file "+path+" but file still exists");
}
}
}
});