summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-08-30 14:23:36 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-15 17:36:56 +0200
commitfe8ef0dd36f4a2eea2806cc7b4f89cf5b734d51e (patch)
tree60697d6b0d1c2d2ba10d7775572a0c7f314bd67d /apps/files_sharing
parente545c2eec56c1f5c99485d4a29949d975961084c (diff)
downloadnextcloud-server-fe8ef0dd36f4a2eea2806cc7b4f89cf5b734d51e.tar.gz
nextcloud-server-fe8ef0dd36f4a2eea2806cc7b4f89cf5b734d51e.zip
Add reshare activities for the parent sharee and the original file owner
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/activity.php42
1 files changed, 38 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/activity.php
index 204c0a037b9..1257e7a445c 100644
--- a/apps/files_sharing/lib/activity.php
+++ b/apps/files_sharing/lib/activity.php
@@ -23,9 +23,9 @@
namespace OCA\Files_Sharing;
-use OC\L10N\Factory;
use OCP\Activity\IExtension;
use OCP\IURLGenerator;
+use OCP\L10N\IFactory;
class Activity implements IExtension {
const FILES_SHARING_APP = 'files_sharing';
@@ -55,19 +55,22 @@ class Activity implements IExtension {
const SUBJECT_SHARED_GROUP_SELF = 'shared_group_self';
const SUBJECT_SHARED_LINK_SELF = 'shared_link_self';
const SUBJECT_SHARED_USER_SELF = 'shared_user_self';
+ const SUBJECT_RESHARED_GROUP_BY = 'reshared_group_by';
+ const SUBJECT_RESHARED_LINK_BY = 'reshared_link_by';
+ const SUBJECT_RESHARED_USER_BY = 'reshared_user_by';
const SUBJECT_SHARED_WITH_BY = 'shared_with_by';
- /** @var Factory */
+ /** @var IFactory */
protected $languageFactory;
/** @var IURLGenerator */
protected $URLGenerator;
/**
- * @param Factory $languageFactory
+ * @param IFactory $languageFactory
* @param IURLGenerator $URLGenerator
*/
- public function __construct(Factory $languageFactory, IURLGenerator $URLGenerator) {
+ public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator) {
$this->languageFactory = $languageFactory;
$this->URLGenerator = $URLGenerator;
}
@@ -169,6 +172,12 @@ class Activity implements IExtension {
return (string) $l->t('You shared %1$s with %2$s', $params);
case self::SUBJECT_SHARED_GROUP_SELF:
return (string) $l->t('You shared %1$s with group %2$s', $params);
+ case self::SUBJECT_RESHARED_USER_BY:
+ return (string) $l->t('%2$s shared %1$s with %3$s', $params);
+ case self::SUBJECT_RESHARED_GROUP_BY:
+ return (string) $l->t('%2$s shared %1$s with group %3$s', $params);
+ case self::SUBJECT_RESHARED_LINK_BY:
+ return (string) $l->t('%2$s shared %1$s via link', $params);
case self::SUBJECT_SHARED_WITH_BY:
return (string) $l->t('%2$s shared %1$s with you', $params);
case self::SUBJECT_SHARED_LINK_SELF:
@@ -212,15 +221,35 @@ class Activity implements IExtension {
);
case self::SUBJECT_SHARED_LINK_SELF:
return [0 => 'file'];
+ case self::SUBJECT_RESHARED_LINK_BY:
+ return [
+ 0 => 'file',
+ 1 => 'username',
+ 2 => '',
+ ];
+
case self::SUBJECT_SHARED_USER_SELF:
case self::SUBJECT_SHARED_WITH_BY:
return [0 => 'file', 1 => 'username'];
+ case self::SUBJECT_RESHARED_USER_BY:
+ return [
+ 0 => 'file',
+ 1 => 'username',
+ 2 => 'username',
+ ];
case self::SUBJECT_SHARED_GROUP_SELF:
return [
0 => 'file',
1 => 'group',
];
+
+ case self::SUBJECT_RESHARED_GROUP_BY:
+ return [
+ 0 => 'file',
+ 1 => 'username',
+ 2 => 'group',
+ ];
}
}
@@ -245,6 +274,11 @@ class Activity implements IExtension {
case self::SUBJECT_SHARED_GROUP_SELF:
// Group by user/group
return 1;
+ case self::SUBJECT_RESHARED_USER_BY:
+ case self::SUBJECT_RESHARED_GROUP_BY:
+ // Group by user/group
+ // FIXME: Grouping does currently not work with more then 2 parameters
+ // return 2;
}
}