|
|
|
@ -60,6 +60,8 @@ class Activity implements IProvider { |
|
|
|
const SUBJECT_SHARED_EMAIL_BY = 'shared_with_email_by'; |
|
|
|
const SUBJECT_SHARED_EMAIL_PASSWORD_SEND = 'shared_with_email_password_send'; |
|
|
|
const SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF = 'shared_with_email_password_send_self'; |
|
|
|
const SUBJECT_UNSHARED_EMAIL_SELF = 'unshared_with_email_self'; |
|
|
|
const SUBJECT_UNSHARED_EMAIL_BY = 'unshared_with_email_by'; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param IFactory $languageFactory |
|
|
|
@ -137,6 +139,32 @@ class Activity implements IProvider { |
|
|
|
} else { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); |
|
|
|
} |
|
|
|
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) { |
|
|
|
$event->setParsedSubject($this->l->t('Unshared from %1$s', [ |
|
|
|
$parsedParameters['email']['name'], |
|
|
|
])) |
|
|
|
->setRichSubject($this->l->t('Unshared from {email}'), [ |
|
|
|
'email' => $parsedParameters['email'], |
|
|
|
]); |
|
|
|
if ($this->activityManager->getRequirePNG()) { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png'))); |
|
|
|
} else { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); |
|
|
|
} |
|
|
|
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_BY) { |
|
|
|
$event->setParsedSubject($this->l->t('Unshared from %1$s by %2$s', [ |
|
|
|
$parsedParameters['email']['name'], |
|
|
|
$parsedParameters['actor']['name'], |
|
|
|
])) |
|
|
|
->setRichSubject($this->l->t('Unshared from {email} by {actor}'), [ |
|
|
|
'email' => $parsedParameters['email'], |
|
|
|
'actor' => $parsedParameters['actor'], |
|
|
|
]); |
|
|
|
if ($this->activityManager->getRequirePNG()) { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png'))); |
|
|
|
} else { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); |
|
|
|
} |
|
|
|
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) { |
|
|
|
$event->setParsedSubject($this->l->t('Password for mail share sent to %1$s', [ |
|
|
|
$parsedParameters['email']['name'] |
|
|
|
@ -196,6 +224,29 @@ class Activity implements IProvider { |
|
|
|
} else { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); |
|
|
|
} |
|
|
|
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) { |
|
|
|
$event->setParsedSubject($this->l->t('You unshared %1$s from %2$s by mail', [ |
|
|
|
$parsedParameters['file']['path'], |
|
|
|
$parsedParameters['email']['name'], |
|
|
|
])) |
|
|
|
->setRichSubject($this->l->t('You unshared {file} from {email} by mail'), $parsedParameters); |
|
|
|
if ($this->activityManager->getRequirePNG()) { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png'))); |
|
|
|
} else { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); |
|
|
|
} |
|
|
|
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_BY) { |
|
|
|
$event->setParsedSubject($this->l->t('%3$s unshared %1$s from %2$s by mail', [ |
|
|
|
$parsedParameters['file']['path'], |
|
|
|
$parsedParameters['email']['name'], |
|
|
|
$parsedParameters['actor']['name'], |
|
|
|
])) |
|
|
|
->setRichSubject($this->l->t('{actor} unshared {file} from {email} by mail'), $parsedParameters); |
|
|
|
if ($this->activityManager->getRequirePNG()) { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png'))); |
|
|
|
} else { |
|
|
|
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); |
|
|
|
} |
|
|
|
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) { |
|
|
|
$event->setParsedSubject($this->l->t('Password to access %1$s was sent to %2s', [ |
|
|
|
$parsedParameters['file']['path'], |
|
|
|
@ -231,11 +282,13 @@ class Activity implements IProvider { |
|
|
|
|
|
|
|
switch ($subject) { |
|
|
|
case self::SUBJECT_SHARED_EMAIL_SELF: |
|
|
|
case self::SUBJECT_UNSHARED_EMAIL_SELF: |
|
|
|
return [ |
|
|
|
'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]), |
|
|
|
'email' => $this->generateEmailParameter($parameters[1]), |
|
|
|
]; |
|
|
|
case self::SUBJECT_SHARED_EMAIL_BY: |
|
|
|
case self::SUBJECT_UNSHARED_EMAIL_BY: |
|
|
|
return [ |
|
|
|
'file' => $this->generateFileParameter((int) $event->getObjectId(), $parameters[0]), |
|
|
|
'email' => $this->generateEmailParameter($parameters[1]), |
|
|
|
|