summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-05-19 15:45:14 +0200
committerJoas Schilling <coding@schilljs.com>2017-05-19 15:45:14 +0200
commitedb4956290ae87afc97a24938647e347754dd951 (patch)
tree0f0a0f3e208284f298fd669ea7fa1568e5808bef /apps
parentbcddca9a64fb980019df052a99bc08fbef14b577 (diff)
downloadnextcloud-server-edb4956290ae87afc97a24938647e347754dd951.tar.gz
nextcloud-server-edb4956290ae87afc97a24938647e347754dd951.zip
Fix username and avatar for external users
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/Activity/Provider.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php
index 3efab382640..c3289ed3703 100644
--- a/apps/files/lib/Activity/Provider.php
+++ b/apps/files/lib/Activity/Provider.php
@@ -38,6 +38,8 @@ class Provider implements IProvider {
/** @var IL10N */
protected $l;
+ /** @var IL10N */
+ protected $activityLang;
/** @var IURLGenerator */
protected $url;
@@ -83,6 +85,7 @@ class Provider implements IProvider {
}
$this->l = $this->languageFactory->get('files', $language);
+ $this->activityLang = $this->languageFactory->get('activity', $language);
if ($this->activityManager->isFormattingFilteredObject()) {
try {
@@ -126,6 +129,11 @@ class Provider implements IProvider {
throw new \InvalidArgumentException();
}
+ if (!isset($parsedParameters['user'])) {
+ // External user via public link share
+ $subject = str_replace('{user}', $this->activityLang->t('"remote user"'), $subject);
+ }
+
$this->setSubjects($event, $subject, $parsedParameters);
return $this->eventMerger->mergeEvents('user', $event, $previousEvent);
@@ -182,6 +190,11 @@ class Provider implements IProvider {
throw new \InvalidArgumentException();
}
+ if (!isset($parsedParameters['user'])) {
+ // External user via public link share
+ $subject = str_replace('{user}', $this->activityLang->t('"remote user"'), $subject);
+ }
+
$this->setSubjects($event, $subject, $parsedParameters);
$event = $this->eventMerger->mergeEvents('file', $event, $previousEvent);
@@ -229,6 +242,12 @@ class Provider implements IProvider {
case 'changed_by':
case 'deleted_by':
case 'restored_by':
+ if ($parameters[1] === '') {
+ // External user via public link share
+ return [
+ 'file' => $this->getFile($parameters[0], $event),
+ ];
+ }
return [
'file' => $this->getFile($parameters[0], $event),
'user' => $this->getUser($parameters[1]),
@@ -241,6 +260,13 @@ class Provider implements IProvider {
];
case 'renamed_by':
case 'moved_by':
+ if ($parameters[1] === '') {
+ // External user via public link share
+ return [
+ 'newfile' => $this->getFile($parameters[0]),
+ 'oldfile' => $this->getFile($parameters[2]),
+ ];
+ }
return [
'newfile' => $this->getFile($parameters[0]),
'user' => $this->getUser($parameters[1]),