diff options
-rw-r--r-- | apps/dav/lib/caldav/caldavbackend.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/carddav/carddavbackend.php | 5 | ||||
-rw-r--r-- | apps/dav/lib/dav/sharing/backend.php | 11 |
3 files changed, 14 insertions, 4 deletions
diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php index 4820116e9a6..3aa493e5087 100644 --- a/apps/dav/lib/caldav/caldavbackend.php +++ b/apps/dav/lib/caldav/caldavbackend.php @@ -340,6 +340,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $stmt = $this->db->prepare('DELETE FROM `*PREFIX*calendarchanges` WHERE `calendarid` = ?'); $stmt->execute([$calendarId]); + + $this->sharingBackend->deleteAllShares($calendarId); } /** diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php index d490bdb91ec..9ca166c22a2 100644 --- a/apps/dav/lib/carddav/carddavbackend.php +++ b/apps/dav/lib/carddav/carddavbackend.php @@ -336,10 +336,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->setParameter('id', $addressBookId) ->execute(); - $query->delete('dav_shares') - ->where($query->expr()->eq('resourceid', $query->createNamedParameter($addressBookId))) - ->andWhere($query->expr()->eq('type', $query->createNamedParameter('addressbook'))) - ->execute(); + $this->sharingBackend->deleteAllShares($addressBookId); $query->delete($this->dbCardsPropertiesTable) ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId))) diff --git a/apps/dav/lib/dav/sharing/backend.php b/apps/dav/lib/dav/sharing/backend.php index a68e484902c..0b28891fbc4 100644 --- a/apps/dav/lib/dav/sharing/backend.php +++ b/apps/dav/lib/dav/sharing/backend.php @@ -97,6 +97,17 @@ class Backend { } /** + * @param $resourceId + */ + public function deleteAllShares($resourceId) { + $query = $this->db->getQueryBuilder(); + $query->delete('dav_shares') + ->where($query->expr()->eq('resourceid', $query->createNamedParameter($resourceId))) + ->andWhere($query->expr()->eq('type', $query->createNamedParameter($this->resourceType))) + ->execute(); + } + + /** * @param IShareable $shareable * @param string $element */ |