Skip to content
Snippets Groups Projects
Commit 0acd2a4e authored by Robin Appelman's avatar Robin Appelman
Browse files

dont send notifications for files we know are outside the users view


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent f7d2c163
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ use OCP\Activity\IConsumer;
use OCP\Activity\IEvent;
use OCP\EventDispatcher\Event;
use OCP\Files\Cache\ICacheEvent;
use OCP\Files\IHomeStorage;
use OCP\Group\Events\UserAddedEvent;
use OCP\Group\Events\UserRemovedEvent;
use OCP\Notification\IApp;
......@@ -46,6 +47,18 @@ class Listener implements IConsumer, IApp, INotifier, IDismissableNotifier {
public function cacheListener(Event $event): void {
if ($event instanceof ICacheEvent) {
// ignore files in home storage but outside home directory (trashbin, versions, etc)
if (
$event->getStorage()->instanceOfStorage(IHomeStorage::class) && !(
$event->getPath() === 'files' || str_starts_with($event->getPath(), "files/")
)
) {
return;
}
// ignore appdata
if (str_starts_with($event->getPath(), 'appdata_')) {
return;
}
$this->queue->push('notify_storage_update', [
'storage' => $event->getStorageId(),
'path' => $event->getPath(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment