summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/PhotoCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CardDAV/PhotoCache.php')
-rw-r--r--apps/dav/lib/CardDAV/PhotoCache.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php
index 29c45debdef..c9625914263 100644
--- a/apps/dav/lib/CardDAV/PhotoCache.php
+++ b/apps/dav/lib/CardDAV/PhotoCache.php
@@ -26,15 +26,16 @@ class PhotoCache {
}
/**
- * @param string $hash
+ * @param int $addressBookId
+ * @param string $cardUri
* @param int $size
* @param Card $card
*
* @return ISimpleFile
* @throws NotFoundException
*/
- public function get($hash, $size, Card $card) {
- $folder = $this->getFolder($hash);
+ public function get($addressBookId, $cardUri, $size, Card $card) {
+ $folder = $this->getFolder($addressBookId, $cardUri);
if ($this->isEmpty($folder)) {
$this->init($folder, $card);
@@ -132,10 +133,12 @@ class PhotoCache {
/**
- * @param $hash
+ * @param int $addressBookId
+ * @param string $cardUri
* @return ISimpleFolder
*/
- private function getFolder($hash) {
+ private function getFolder($addressBookId, $cardUri) {
+ $hash = md5($addressBookId . ' ' . $cardUri);
try {
return $this->appData->getFolder($hash);
} catch (NotFoundException $e) {
@@ -231,4 +234,13 @@ class PhotoCache {
}
return '';
}
+
+ /**
+ * @param int $addressBookId
+ * @param string $cardUri
+ */
+ public function delete($addressBookId, $cardUri) {
+ $folder = $this->getFolder($addressBookId, $cardUri);
+ $folder->delete();
+ }
}