diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-05-03 15:11:26 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-05-08 11:20:49 +0200 |
commit | 3ab53d000f5e5e9d35e459109fc61c2ef936752d (patch) | |
tree | 8d8433ea2b2b72d18e746a232ee96556cc71dfb7 /apps/dav/lib/AppInfo | |
parent | 34d97aa51c5e7ddb638aeb105a590ae159a34abe (diff) | |
download | nextcloud-server-3ab53d000f5e5e9d35e459109fc61c2ef936752d.tar.gz nextcloud-server-3ab53d000f5e5e9d35e459109fc61c2ef936752d.zip |
Clear cache on vcard change/delete
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/AppInfo')
-rw-r--r-- | apps/dav/lib/AppInfo/Application.php | 13 |
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); |