summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-07-06 10:23:33 +0200
committerJoas Schilling <nickvergessen@gmx.de>2015-07-06 10:23:33 +0200
commit4dbc8ab77fb9aa45f250302a46c4146d63ea0cc2 (patch)
treeee9784b8fb174059908f294f2c9db371f9549153 /apps/files_sharing/api
parentfca6bcb6328546da5fb75ab51bcd36cc671d0cc9 (diff)
parentddb8cc23034ebd4ca5bc16a35ae9d18ac5fb8dac (diff)
downloadnextcloud-server-4dbc8ab77fb9aa45f250302a46c4146d63ea0cc2.tar.gz
nextcloud-server-4dbc8ab77fb9aa45f250302a46c4146d63ea0cc2.zip
Merge pull request #17335 from owncloud/better-federated-cloud-sharing-activities
Improve federated cloud sharing activities
Diffstat (limited to 'apps/files_sharing/api')
-rw-r--r--apps/files_sharing/api/server2server.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php
index 3ecdf65dc74..8bda0bb8749 100644
--- a/apps/files_sharing/api/server2server.php
+++ b/apps/files_sharing/api/server2server.php
@@ -22,6 +22,8 @@
namespace OCA\Files_Sharing\API;
+use OCA\Files_Sharing\Activity;
+
class Server2Server {
/**
@@ -69,8 +71,8 @@ class Server2Server {
$user = $owner . '@' . $this->cleanupRemote($remote);
\OC::$server->getActivityManager()->publishActivity(
- 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_RECEIVED, array($user), '', array(),
- '', '', $shareWith, \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_LOW);
+ Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_RECEIVED, array($user, trim($name, '/')), '', array(),
+ '', '', $shareWith, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW);
return new \OC_OCS_Result();
} catch (\Exception $e) {
@@ -102,8 +104,8 @@ class Server2Server {
list($file, $link) = self::getFile($share['uid_owner'], $share['file_source']);
\OC::$server->getActivityManager()->publishActivity(
- 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_ACCEPTED, array($share['share_with'], basename($file)), '', array(),
- $file, $link, $share['uid_owner'], \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_LOW);
+ Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_ACCEPTED, array($share['share_with'], basename($file)), '', array(),
+ $file, $link, $share['uid_owner'], Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW);
}
return new \OC_OCS_Result();
@@ -133,8 +135,8 @@ class Server2Server {
list($file, $link) = $this->getFile($share['uid_owner'], $share['file_source']);
\OC::$server->getActivityManager()->publishActivity(
- 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_DECLINED, array($share['share_with'], basename($file)), '', array(),
- $file, $link, $share['uid_owner'], \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_LOW);
+ Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_DECLINED, array($share['share_with'], basename($file)), '', array(),
+ $file, $link, $share['uid_owner'], Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW);
}
return new \OC_OCS_Result();
@@ -170,9 +172,15 @@ class Server2Server {
$query = \OCP\DB::prepare('DELETE FROM `*PREFIX*share_external` WHERE `remote_id` = ? AND `share_token` = ?');
$query->execute(array($id, $token));
+ if ($share['accepted']) {
+ $path = trim($mountpoint, '/');
+ } else {
+ $path = trim($share['name'], '/');
+ }
+
\OC::$server->getActivityManager()->publishActivity(
- 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $mountpoint), '', array(),
- '', '', $user, \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_MEDIUM);
+ Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $path), '', array(),
+ '', '', $user, Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_MEDIUM);
}
return new \OC_OCS_Result();