}
if ($event->getSubject() === self::ASSIGN_TAG) {
- if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
+ if ($parsedParameters['actor']['id'] === '') {
+ $event->setParsedSubject($this->l->t('System tag %1$s added by the system', [
+ $this->generatePlainSystemTag($parsedParameters['systemtag']),
+ ]))
+ ->setRichSubject($this->l->t('Added system tag {systemtag}'), [
+ 'systemtag' => $parsedParameters['systemtag'],
+ ]);
+ } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
$event->setParsedSubject($this->l->t('Added system tag %1$s', [
$this->generatePlainSystemTag($parsedParameters['systemtag']),
]))
]);
}
} else if ($event->getSubject() === self::UNASSIGN_TAG) {
- if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
+ if ($parsedParameters['actor']['id'] === '') {
+ $event->setParsedSubject($this->l->t('System tag %1$s removed by the system', [
+ $this->generatePlainSystemTag($parsedParameters['systemtag']),
+ ]))
+ ->setRichSubject($this->l->t('Removed system tag {systemtag}'), [
+ 'systemtag' => $parsedParameters['systemtag'],
+ ]);
+ } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
$event->setParsedSubject($this->l->t('Removed system tag %1$s', [
$this->generatePlainSystemTag($parsedParameters['systemtag']),
]))
->setRichSubject($this->l->t('{actor} updated system tag {oldsystemtag} to {newsystemtag}'), $parsedParameters);
}
} else if ($event->getSubject() === self::ASSIGN_TAG) {
- if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
+ if ($parsedParameters['actor']['id'] === '') {
+ unset($parsedParameters['actor']);
+ $event->setParsedSubject($this->l->t('System tag %2$s was added to %1$s by the system', [
+ $parsedParameters['file']['path'],
+ $this->generatePlainSystemTag($parsedParameters['systemtag']),
+ ]))
+ ->setRichSubject($this->l->t('System tag {systemtag} was added to {file} by the system'), $parsedParameters);
+ } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
$event->setParsedSubject($this->l->t('You added system tag %2$s to %1$s', [
$parsedParameters['file']['path'],
$this->generatePlainSystemTag($parsedParameters['systemtag']),
->setRichSubject($this->l->t('{actor} added system tag {systemtag} to {file}'), $parsedParameters);
}
} else if ($event->getSubject() === self::UNASSIGN_TAG) {
- if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
+ if ($parsedParameters['actor']['id'] === '') {
+ unset($parsedParameters['actor']);
+ $event->setParsedSubject($this->l->t('System tag %2$s was removed from %1$s by the system', [
+ $parsedParameters['file']['path'],
+ $this->generatePlainSystemTag($parsedParameters['systemtag']),
+ ]))
+ ->setRichSubject($this->l->t('System tag {systemtag} was removed from {file} by the system'), $parsedParameters);
+ } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
$event->setParsedSubject($this->l->t('You removed system tag %2$s from %1$s', [
$parsedParameters['file']['path'],
$this->generatePlainSystemTag($parsedParameters['systemtag']),
case self::CREATE_TAG:
case self::DELETE_TAG:
return [
- 'actor' => $this->getUserParameter($parameters[0]),
+ 'actor' => $this->getUserParameter((string) $parameters[0]),
'systemtag' => $this->getSystemTagParameter($parameters[1]),
];
case self::UPDATE_TAG:
return [
- 'actor' => $this->getUserParameter($parameters[0]),
+ 'actor' => $this->getUserParameter((string) $parameters[0]),
'newsystemtag' => $this->getSystemTagParameter($parameters[1]),
'oldsystemtag' => $this->getSystemTagParameter($parameters[2]),
];
case self::ASSIGN_TAG:
case self::UNASSIGN_TAG:
return [
- 'actor' => $this->getUserParameter($parameters[0]),
+ 'actor' => $this->getUserParameter((string) $parameters[0]),
'file' => $this->getFileParameter($event->getObjectId(), $parameters[1]),
'systemtag' => $this->getSystemTagParameter($parameters[2]),
];