diff options
Diffstat (limited to 'apps/files_sharing/lib/External/Manager.php')
-rw-r--r-- | apps/files_sharing/lib/External/Manager.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index 54d0f9bd0c3..fe4fe492a2b 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -197,6 +197,7 @@ class Manager { public function acceptShare($id) { $share = $this->getShare($id); + $result = false; if ($share) { \OC_Util::setupFS($this->uid); @@ -211,16 +212,18 @@ class Manager { `mountpoint` = ?, `mountpoint_hash` = ? WHERE `id` = ? AND `user` = ?'); - $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid)); - $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept'); - - \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]); - - $this->processNotification($id); - return true; + $updated = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid)); + if ($updated === true) { + $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept'); + \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]); + $result = true; + } } - return false; + // Make sure the user has no notification for something that does not exist anymore. + $this->processNotification($id); + + return $result; } /** |