From 7e3f8d3ac1c43f5eafe8e2740d75e635f9562f1f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Jul 2015 12:24:20 +0200 Subject: [PATCH] Use the item name when refering to the unaccepted remote share --- apps/files_sharing/api/server2server.php | 8 +++++++- apps/files_sharing/lib/activity.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index 3ecdf65dc7..ecdfd8bb14 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -170,8 +170,14 @@ 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(), + 'files_sharing', \OCA\Files_Sharing\Activity::SUBJECT_REMOTE_SHARE_UNSHARED, array($owner, $path), '', array(), '', '', $user, \OCA\Files_Sharing\Activity::TYPE_REMOTE_SHARE, \OCA\Files_Sharing\Activity::PRIORITY_MEDIUM); } diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php index a21f57235c..6903301a4d 100644 --- a/apps/files_sharing/lib/activity.php +++ b/apps/files_sharing/lib/activity.php @@ -190,12 +190,12 @@ class Activity implements IExtension { if ($app === self::FILES_SHARING_APP) { switch ($text) { case self::SUBJECT_REMOTE_SHARE_RECEIVED: + case self::SUBJECT_REMOTE_SHARE_UNSHARED: return array( 0 => '',// We can not use 'username' since the user is in a different ownCloud ); case self::SUBJECT_REMOTE_SHARE_ACCEPTED: case self::SUBJECT_REMOTE_SHARE_DECLINED: - case self::SUBJECT_REMOTE_SHARE_UNSHARED: return array( 0 => '',// We can not use 'username' since the user is in a different ownCloud 1 => 'file',