From 9e1cd6d8735010e8b462258668a101abc2ea184b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 16 Sep 2015 12:05:06 +0200 Subject: [PATCH 1/2] Change the order of the buttons --- apps/files_sharing/api/server2server.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index 6ecaea2053..b3d54b5d0c 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -93,15 +93,15 @@ class Server2Server { ->setObject('remote_share', $remoteId) ->setSubject('remote_share', [$user, trim($name, '/')]); - $acceptAction = $notification->createAction(); - $acceptAction->setLabel('accept') - ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/' . $remoteId), 'POST'); $declineAction = $notification->createAction(); $declineAction->setLabel('decline') ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/' . $remoteId), 'DELETE'); + $notification->addAction($declineAction); - $notification->addAction($acceptAction) - ->addAction($declineAction); + $acceptAction = $notification->createAction(); + $acceptAction->setLabel('accept') + ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/' . $remoteId), 'POST'); + $notification->addAction($acceptAction); $notificationManager->notify($notification); From 6bc93c740194d245bb9a7d1f230ed33461f842a7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 16 Sep 2015 12:08:21 +0200 Subject: [PATCH 2/2] Disable the remote sharing notifications until they work properly --- apps/files_sharing/api/server2server.php | 3 +++ apps/files_sharing/appinfo/app.php | 3 +++ apps/files_sharing/lib/external/manager.php | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index b3d54b5d0c..7d8860ad6f 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -83,6 +83,8 @@ class Server2Server { Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_RECEIVED, array($user, trim($name, '/')), '', array(), '', '', $shareWith, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW); + /** + * FIXME $urlGenerator = \OC::$server->getURLGenerator(); $notificationManager = \OC::$server->getNotificationManager(); @@ -104,6 +106,7 @@ class Server2Server { $notification->addAction($acceptAction); $notificationManager->notify($notification); + */ return new \OC_OCS_Result(); } catch (\Exception $e) { diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 8d919d1466..15c0b864b0 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -113,9 +113,12 @@ if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') { } } +/** + * FIXME $manager = \OC::$server->getNotificationManager(); $manager->registerNotifier(function() { return new \OCA\Files_Sharing\Notifier( \OC::$server->getL10NFactory() ); }); + */ diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php index 17142e9509..8552b2fbd3 100644 --- a/apps/files_sharing/lib/external/manager.php +++ b/apps/files_sharing/lib/external/manager.php @@ -214,7 +214,7 @@ class Manager { $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid)); $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept'); - $this->scrapNotification($share['remote_id']); + //FIXME $this->scrapNotification($share['remote_id']); return true; } @@ -237,7 +237,7 @@ class Manager { $removeShare->execute(array($id, $this->uid)); $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); - $this->scrapNotification($share['remote_id']); + //FIXME $this->scrapNotification($share['remote_id']); return true; }