From 31c9e047a80d849a68e050f69e5b4cffdfca9056 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Feb 2016 10:12:14 +0100 Subject: [PATCH] Delete the notification when the owner unshares the remote before the user did anything --- apps/files_sharing/api/server2server.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index a27b3a3bd8..f04ddc81b8 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -225,6 +225,13 @@ class Server2Server { $path = trim($share['name'], '/'); } + $notificationManager = \OC::$server->getNotificationManager(); + $notification = $notificationManager->createNotification(); + $notification->setApp('files_sharing') + ->setUser($share['user']) + ->setObject('remote_share', (int) $share['id']); + $notificationManager->markProcessed($notification); + \OC::$server->getActivityManager()->publishActivity( Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $path), '', array(), '', '', $user, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_MEDIUM);