From 040c5411386d05f64c6dc2a6e3d52ba5c3af9f96 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Thu, 23 Jun 2016 14:19:55 +0200
Subject: [PATCH] Remove a fed share from the local table before trying to
 notify the remote server

---
 apps/federatedfilesharing/lib/FederatedShareProvider.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 4892908c329..01737256769 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -473,6 +473,8 @@ class FederatedShareProvider implements IShareProvider {
 
 		$isOwner = false;
 
+		$this->removeShareFromTable($share);
+
 		// if the local user is the owner we can send the unShare request directly...
 		if ($this->userManager->userExists($share->getShareOwner())) {
 			$this->notifications->sendRemoteUnShare($remote, $share->getId(), $share->getToken());
@@ -494,8 +496,6 @@ class FederatedShareProvider implements IShareProvider {
 			}
 			$this->notifications->sendRevokeShare($remote, $remoteId, $share->getToken());
 		}
-
-		$this->removeShareFromTable($share);
 	}
 
 	/**
-- 
GitLab