/** * * Declines the invitation sent by the original owner on a remote server * * @param RemoteShare $remoteShare * @return boolean success * @throws \Exception */ public function declineInvitation(RemoteShare $remoteShare) { $url = $remoteShare->getOcsServiceUrl(); $client = self::getClient($url); $response = $client->post($remoteShare->getOcsRemoteId() . '/decline', ['body' => ['token' => $remoteShare->getOcsToken()]]); if ($response->getStatusCode() != 200) { throw new \Exception($response->getReasonPhrase()); } return true; }