summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Activity/Providers
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-23 14:02:38 +0100
committerGitHub <noreply@github.com>2016-11-23 14:02:38 +0100
commit2eca9cc384e967c9b619eb5c6a484ab70e3aea17 (patch)
treedf68d4cbd80179fd2add7881bb28823aaf8fa968 /apps/files_sharing/lib/Activity/Providers
parentf692ea34f1f1ce128ad40e3bf248c6342260c6c1 (diff)
parente9336dddd5cc6eb407b3a88b5bd842198966b7aa (diff)
downloadnextcloud-server-2eca9cc384e967c9b619eb5c6a484ab70e3aea17.tar.gz
nextcloud-server-2eca9cc384e967c9b619eb5c6a484ab70e3aea17.zip
Merge pull request #2262 from nextcloud/specify-parameters-on-public-download
Specify the parameters on public download
Diffstat (limited to 'apps/files_sharing/lib/Activity/Providers')
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Downloads.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Activity/Providers/Downloads.php b/apps/files_sharing/lib/Activity/Providers/Downloads.php
index 84ef5895dde..39e2a846b30 100644
--- a/apps/files_sharing/lib/Activity/Providers/Downloads.php
+++ b/apps/files_sharing/lib/Activity/Providers/Downloads.php
@@ -87,7 +87,7 @@ class Downloads implements IProvider {
public function parseShortVersion(IEvent $event) {
$parsedParameters = $this->getParsedParameters($event);
- if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED ||
+ if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED ||
$event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED) {
$event->setParsedSubject($this->l->t('Downloaded via public link'))
->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg')));
@@ -114,7 +114,7 @@ class Downloads implements IProvider {
public function parseLongVersion(IEvent $event) {
$parsedParameters = $this->getParsedParameters($event);
- if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED ||
+ if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED ||
$event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED) {
$event->setParsedSubject($this->l->t('%1$s downloaded via public link', [
$parsedParameters['file']['path'],
@@ -150,6 +150,11 @@ class Downloads implements IProvider {
$parameters = $event->getSubjectParameters();
switch ($subject) {
+ case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED:
+ case self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED:
+ return [
+ 'file' => $this->generateFileParameter($event->getObjectId(), $parameters[0]),
+ ];
case self::SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED:
case self::SUBJECT_SHARED_FOLDER_BY_EMAIL_DOWNLOADED:
return [
@@ -161,7 +166,8 @@ class Downloads implements IProvider {
],
];
}
- return [];
+
+ throw new \InvalidArgumentException();
}
/**