Browse Source

use new user agent

tobiaskaminsky 7 years ago
parent
commit
64221ece39

+ 1 - 1
src/main/java/com/owncloud/android/files/services/FileDownloader.java

@@ -450,7 +450,7 @@ public class FileDownloader extends Service
 
 
                     /// perform the download
-                    downloadResult = mCurrentDownload.execute(mDownloadClient);
+                    downloadResult = mCurrentDownload.execute(mDownloadClient, mCurrentDownload.getFile().isEncrypted());
                     if (downloadResult.isSuccess()) {
                         saveDownloadedFile();
                     }

+ 2 - 2
src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java

@@ -271,7 +271,7 @@ public class RefreshFolderOperation extends RemoteOperation {
 
         // remote request 
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
-        result = operation.execute(client);
+        result = operation.execute(client, true);
         if (result.isSuccess()) {
             OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
 
@@ -313,7 +313,7 @@ public class RefreshFolderOperation extends RemoteOperation {
     private RemoteOperationResult fetchAndSyncRemoteFolder(OwnCloudClient client) {
         String remotePath = mLocalFolder.getRemotePath();
         ReadRemoteFolderOperation operation = new ReadRemoteFolderOperation(remotePath);
-        RemoteOperationResult result = operation.execute(client);
+        RemoteOperationResult result = operation.execute(client, true);
         Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath);
 
         if (result.isSuccess()) {

+ 4 - 3
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -374,6 +374,7 @@ public class UploadFileOperation extends SyncOperation {
 
         OCFile parent = getStorageManager().getFileByPath(remoteParentPath);
         mFile.setParentId(parent.getFileId());
+        mFile.setEncrypted(parent.isEncrypted());
 
         // try to unlock folder with stored token, e.g. when upload needs to be resumed or app crashed
         if (parent.isEncrypted() && !mFolderUnlockToken.isEmpty()) {
@@ -873,7 +874,7 @@ public class UploadFileOperation extends SyncOperation {
             }
 
             if (result == null || result.isSuccess() && mUploadOperation != null) {
-                result = mUploadOperation.execute(client);
+                result = mUploadOperation.execute(client, mFile.isEncrypted());
 
                 /// move local temporal file or original file to its corresponding
                 // location in the Nextcloud local folder
@@ -1041,7 +1042,7 @@ public class UploadFileOperation extends SyncOperation {
      */
     private RemoteOperationResult grantFolderExistence(String pathToGrant, OwnCloudClient client) {
         RemoteOperation operation = new ExistenceCheckRemoteOperation(pathToGrant, mContext, false);
-        RemoteOperationResult result = operation.execute(client);
+        RemoteOperationResult result = operation.execute(client, mFile.isEncrypted());
         if (!result.isSuccess() && result.getCode() == ResultCode.FILE_NOT_FOUND && mRemoteFolderToBeCreated) {
             SyncOperation syncOp = new CreateFolderOperation(pathToGrant, true);
             result = syncOp.execute(client, getStorageManager());
@@ -1357,7 +1358,7 @@ public class UploadFileOperation extends SyncOperation {
         }
 
         ReadRemoteFileOperation operation = new ReadRemoteFileOperation(path);
-        RemoteOperationResult result = operation.execute(client);
+        RemoteOperationResult result = operation.execute(client, mFile.isEncrypted());
         if (result.isSuccess()) {
             updateOCFile(file, (RemoteFile) result.getData().get(0));
             file.setLastSyncDateForProperties(syncDate);