From ad348934194106202badc528dab9bd39682e8f72 Mon Sep 17 00:00:00 2001 From: Jonas Mayer Date: Thu, 7 Dec 2023 16:56:41 +0100 Subject: [PATCH] isUploadingNow for uploads after file conflict resolved Signed-off-by: Jonas Mayer --- .../android/files/services/FileUploader.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/files/services/FileUploader.java b/app/src/main/java/com/owncloud/android/files/services/FileUploader.java index 9f3f6ac9f0..eff0050742 100644 --- a/app/src/main/java/com/owncloud/android/files/services/FileUploader.java +++ b/app/src/main/java/com/owncloud/android/files/services/FileUploader.java @@ -1266,16 +1266,23 @@ public class FileUploader extends Service if (useFilesUploadWorker(getApplicationContext())){ UploadFileOperation currentUploadFileOperation = FilesUploadWorker.Companion.getCurrentUploadFileOperation(); if (currentUploadFileOperation == null || currentUploadFileOperation.getUser() == null) return false; - return upload != null && - currentUploadFileOperation.getUser().getAccountName() != null && - upload.getAccountName().equals(currentUploadFileOperation.getUser().getAccountName()) && - upload.getRemotePath().equals(currentUploadFileOperation.getRemotePath()); + if (upload == null || (!upload.getAccountName().equals(currentUploadFileOperation.getUser().getAccountName()))) return false; + if (currentUploadFileOperation.getOldFile() != null){ + // For file conflicts check old file remote path + return upload.getRemotePath().equals(currentUploadFileOperation.getRemotePath()) || + upload.getRemotePath().equals(currentUploadFileOperation.getOldFile().getRemotePath()); + } + return upload.getRemotePath().equals(currentUploadFileOperation.getRemotePath()); + }else { + return upload != null && mCurrentAccount != null && mCurrentUpload != null && upload.getAccountName().equals(mCurrentAccount.name) && - upload.getRemotePath().equals(mCurrentUpload.getRemotePath()); + (upload.getRemotePath().equals(mCurrentUpload.getRemotePath()) || + (mCurrentUpload.getOldFile() != null && + upload.getRemotePath().equals(mCurrentUpload.getOldFile().getRemotePath()))); } }