added more logging for file deletion
This commit is contained in:
parent
3409399ef1
commit
82908fb54b
|
@ -1287,18 +1287,23 @@ public class XmppConnectionService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void markFileDeleted(final String path) {
|
private void markFileDeleted(final String path) {
|
||||||
|
Log.d(Config.LOGTAG,"deleted file "+path);
|
||||||
for (Conversation conversation : getConversations()) {
|
for (Conversation conversation : getConversations()) {
|
||||||
conversation.findMessagesWithFiles(new Conversation.OnMessageFound() {
|
conversation.findMessagesWithFiles(new Conversation.OnMessageFound() {
|
||||||
@Override
|
@Override
|
||||||
public void onMessageFound(Message message) {
|
public void onMessageFound(Message message) {
|
||||||
DownloadableFile file = fileBackend.getFile(message);
|
DownloadableFile file = fileBackend.getFile(message);
|
||||||
if (file.getAbsolutePath().equals(path) && !file.exists()) {
|
if (file.getAbsolutePath().equals(path)) {
|
||||||
message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED));
|
if (file.exists()) {
|
||||||
final int s = message.getStatus();
|
message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED));
|
||||||
if (s == Message.STATUS_WAITING || s == Message.STATUS_OFFERED || s == Message.STATUS_UNSEND) {
|
final int s = message.getStatus();
|
||||||
markMessage(message, Message.STATUS_SEND_FAILED);
|
if (s == Message.STATUS_WAITING || s == Message.STATUS_OFFERED || s == Message.STATUS_UNSEND) {
|
||||||
|
markMessage(message, Message.STATUS_SEND_FAILED);
|
||||||
|
} else {
|
||||||
|
updateConversationUi();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
updateConversationUi();
|
Log.d(Config.LOGTAG,"found matching message for file "+path+" but file still exists");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue