aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/AppInfo/Application.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/AppInfo/Application.php')
-rw-r--r--apps/dav/lib/AppInfo/Application.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index d13f24d369a..5d89324d4a9 100644
--- a/apps/dav/lib/AppInfo/Application.php
+++ b/apps/dav/lib/AppInfo/Application.php
@@ -112,6 +112,19 @@ class Application extends App {
}
});
+ $clearPhotoCache = function($event) {
+ if ($event instanceof GenericEvent) {
+ /** @var PhotoCache $p */
+ $p = $this->getContainer()->query(PhotoCache::class);
+ $p->delete(
+ $event->getArgument('addressBookId'),
+ $event->getArgument('cardUri')
+ );
+ }
+ };
+ $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $clearPhotoCache);
+ $dispatcher->addListener('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', $clearPhotoCache);
+
$dispatcher->addListener('OC\AccountManager::userUpdated', function(GenericEvent $event) {
$user = $event->getSubject();
$syncService = $this->getContainer()->query(SyncService::class);