X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/1f6eb722f4e81fd6d9b148215ba2e891dabd0824..8d493de0ea590d669dadad7f2fe6d22fd72f9cb5:/src/com/owncloud/android/operations/UnshareLinkOperation.java?ds=sidebyside diff --git a/src/com/owncloud/android/operations/UnshareLinkOperation.java b/src/com/owncloud/android/operations/UnshareLinkOperation.java index b1ec9ccc..c588ec1a 100644 --- a/src/com/owncloud/android/operations/UnshareLinkOperation.java +++ b/src/com/owncloud/android/operations/UnshareLinkOperation.java @@ -17,14 +17,12 @@ package com.owncloud.android.operations; -import java.util.ArrayList; - import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.operations.common.OCShare; import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; -import com.owncloud.android.lib.operations.remote.GetRemoteSharesOperation; +import com.owncloud.android.lib.operations.remote.UnshareLinkRemoteOperation; import com.owncloud.android.operations.common.SyncOperation; import com.owncloud.android.utils.Log_OC; @@ -52,13 +50,16 @@ public class UnshareLinkOperation extends SyncOperation { OCShare share = getStorageManager().getShareByPath(mFile.getRemotePath()); if (share != null) { - GetRemoteSharesOperation operation = new GetRemoteSharesOperation(); + UnshareLinkRemoteOperation operation = new UnshareLinkRemoteOperation((int) share.getIdRemoteShared()); result = operation.execute(client); if (result.isSuccess()) { Log_OC.d(TAG, "Share id = " + share.getIdRemoteShared() + " deleted"); - // TODO Update DB + mFile.setShareByLink(false); + mFile.setPublicLink(""); + getStorageManager().saveFile(mFile); + getStorageManager().removeShare(share); } } else {