X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/7c9d9e7b3a56229f97cf1bf193f61d4aedd09806..966daf3b9ec4e978b35408252a88ef5accbe59b1:/src/com/owncloud/android/operations/SynchronizeFileOperation.java diff --git a/src/com/owncloud/android/operations/SynchronizeFileOperation.java b/src/com/owncloud/android/operations/SynchronizeFileOperation.java index fb6ce52f..b5f6575a 100644 --- a/src/com/owncloud/android/operations/SynchronizeFileOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFileOperation.java @@ -49,7 +49,6 @@ public class SynchronizeFileOperation extends RemoteOperation { private FileDataStorageManager mStorageManager; private Account mAccount; private boolean mSyncFileContents; - private boolean mLocalChangeAlreadyKnown; private Context mContext; private boolean mTransferWasRequested = false; @@ -60,7 +59,6 @@ public class SynchronizeFileOperation extends RemoteOperation { FileDataStorageManager storageManager, Account account, boolean syncFileContents, - boolean localChangeAlreadyKnown, Context context) { mLocalFile = localFile; @@ -68,7 +66,6 @@ public class SynchronizeFileOperation extends RemoteOperation { mStorageManager = storageManager; mAccount = account; mSyncFileContents = syncFileContents; - mLocalChangeAlreadyKnown = localChangeAlreadyKnown; mContext = context; } @@ -112,17 +109,19 @@ public class SynchronizeFileOperation extends RemoteOperation { /// check changes in server and local file boolean serverChanged = false; + /* time for eTag is coming, but not yet if (mServerFile.getEtag() != null) { serverChanged = (!mServerFile.getEtag().equals(mLocalFile.getEtag())); // TODO could this be dangerous when the user upgrades the server from non-tagged to tagged? - } else { + } else { */ // server without etags serverChanged = (mServerFile.getModificationTimestamp() > mLocalFile.getModificationTimestampAtLastSyncForData()); - } - boolean localChanged = (mLocalChangeAlreadyKnown || mLocalFile.getLocalModificationTimestamp() > mLocalFile.getLastSyncDateForData()); + //} + boolean localChanged = (mLocalFile.getLocalModificationTimestamp() > mLocalFile.getLastSyncDateForData()); // TODO this will be always true after the app is upgraded to database version 2; will result in unnecessary uploads /// decide action to perform depending upon changes - if (!mLocalFile.getEtag().isEmpty() && localChanged && serverChanged) { + //if (!mLocalFile.getEtag().isEmpty() && localChanged && serverChanged) { + if (localChanged && serverChanged) { result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); } else if (localChanged) {