--- /dev/null
+<svg xmlns="http://www.w3.org/2000/svg" height="32" width="32" viewBox="0 0 32 32"><path fill="#000" d="M16 3C7.163 3 0 7.925 0 14s7.163 11 16 11c.5 0 .98-.032 1.47-.063L26 32v-9.406c3.658-2.017 6-5.12 6-8.595 0-6.076-7.164-11-16-11z"/></svg>
if ($event->getSubject() === 'add_comment_subject') {
$this->parseMessage($event);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/comment.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/comment.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/comment.svg')));
+ }
if ($this->activityManager->isFormattingFilteredObject()) {
try {
$this->l = $this->languageFactory->get('dav', $language);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg')));
+ }
if ($event->getSubject() === self::SUBJECT_ADD) {
$subject = $this->l->t('{actor} created calendar {calendar}');
$this->l = $this->languageFactory->get('dav', $language);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg')));
+ }
if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event') {
$subject = $this->l->t('{actor} created event {event} in calendar {calendar}');
$this->l = $this->languageFactory->get('dav', $language);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg')));
+ }
if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo') {
$subject = $this->l->t('{actor} created todo {todo} in list {calendar}');
public function parseShortVersion(IEvent $event) {
if ($event->getSubject() === self::SUBJECT_ADDED) {
- $event->setParsedSubject($this->l->t('Added to favorites'))
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
+ $event->setParsedSubject($this->l->t('Added to favorites'));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_REMOVED) {
- $event->setParsedSubject($this->l->t('Removed from favorites'))
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
+ $event->setParsedSubject($this->l->t('Removed from favorites'));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
+ }
} else {
throw new \InvalidArgumentException();
}
if ($event->getSubject() === self::SUBJECT_ADDED) {
$subject = $this->l->t('You added {file} to your favorites');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
+ }
} else if ($event->getSubject() === self::SUBJECT_REMOVED) {
$subject = $this->l->t('You removed {file} from your favorites');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star.svg')));
+ }
} else {
throw new \InvalidArgumentException();
}
if ($event->getSubject() === 'created_by') {
$subject = $this->l->t('Created by {user}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ }
} else if ($event->getSubject() === 'changed_by') {
$subject = $this->l->t('Changed by {user}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'deleted_by') {
$subject = $this->l->t('Deleted by {user}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg')));
+ }
} else if ($event->getSubject() === 'restored_by') {
$subject = $this->l->t('Restored by {user}');
} else if ($event->getSubject() === 'renamed_by') {
$subject = $this->l->t('Renamed by {user}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'moved_by') {
$subject = $this->l->t('Moved by {user}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else {
throw new \InvalidArgumentException();
}
if ($event->getSubject() === 'created_self') {
$subject = $this->l->t('You created {file}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ }
} else if ($event->getSubject() === 'created_by') {
$subject = $this->l->t('{user} created {file}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ }
} else if ($event->getSubject() === 'created_public') {
$subject = $this->l->t('{file} was created in a public folder');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'add-color.svg')));
+ }
} else if ($event->getSubject() === 'changed_self') {
$subject = $this->l->t('You changed {file}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'changed_by') {
$subject = $this->l->t('{user} changed {file}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'deleted_self') {
$subject = $this->l->t('You deleted {file}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg')));
+ }
} else if ($event->getSubject() === 'deleted_by') {
$subject = $this->l->t('{user} deleted {file}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'delete-color.svg')));
+ }
} else if ($event->getSubject() === 'restored_self') {
$subject = $this->l->t('You restored {file}');
} else if ($event->getSubject() === 'restored_by') {
$subject = $this->l->t('{user} restored {file}');
} else if ($event->getSubject() === 'renamed_self') {
$subject = $this->l->t('You renamed {oldfile} to {newfile}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'renamed_by') {
$subject = $this->l->t('{user} renamed {oldfile} to {newfile}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'moved_self') {
$subject = $this->l->t('You moved {oldfile} to {newfile}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else if ($event->getSubject() === 'moved_by') {
$subject = $this->l->t('{user} moved {oldfile} to {newfile}');
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('files', 'change.svg')));
+ }
} else {
throw new \InvalidArgumentException();
}
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/download.svg')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
throw new \InvalidArgumentException();
}
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ 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')));
+ }
$this->setSubjects($event, $subject, $parsedParameters);
return $event;
]))
->setRichSubject($this->l->t('Shared with {email}'), [
'email' => $parsedParameters['email'],
- ])
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ]);
+ 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_BY) {
$event->setParsedSubject($this->l->t('Shared with %1$s by %2$s', [
$parsedParameters['email']['name'],
->setRichSubject($this->l->t('Shared with {email} by {actor}'), [
'email' => $parsedParameters['email'],
'actor' => $parsedParameters['actor'],
- ])
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ]);
+ 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']
]))
->setRichSubject($this->l->t('Password for mail share sent to {email}'), [
'email' => $parsedParameters['email']
- ])
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ]);
+ 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_SELF) {
$event->setParsedSubject($this->l->t('Password for mail share sent to you'))
- ->setRichSubject($this->l->t('Password for mail share sent to you'))
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('Password for mail share sent to you'));
+ 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 {
throw new \InvalidArgumentException();
}
$parsedParameters['file']['path'],
$parsedParameters['email']['name'],
]))
- ->setRichSubject($this->l->t('You shared {file} with {email} by mail'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('You shared {file} with {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_BY) {
$event->setParsedSubject($this->l->t('%3$s shared %1$s with %2$s by mail', [
$parsedParameters['file']['path'],
$parsedParameters['email']['name'],
$parsedParameters['actor']['name'],
]))
- ->setRichSubject($this->l->t('{actor} shared {file} with {email} by mail'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('{actor} shared {file} with {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'],
$parsedParameters['email']['name']
]))
- ->setRichSubject($this->l->t('Password to access {file} was sent to {email}'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('Password to access {file} was sent to {email}'), $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_SELF) {
$event->setParsedSubject(
$this->l->t('Password to access %1$s was sent to you',
[$parsedParameters['file']['path']]))
- ->setRichSubject($this->l->t('Password to access {file} was sent to you'), $parsedParameters)
- ->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
+ ->setRichSubject($this->l->t('Password to access {file} was sent to you'), $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 {
throw new \InvalidArgumentException();
*/
public function parseShortVersion(IEvent $event) {
$parsedParameters = $this->getParameters($event);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg')));
+
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg')));
+ }
if ($event->getSubject() === self::ASSIGN_TAG) {
if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
*/
public function parseLongVersion(IEvent $event) {
$parsedParameters = $this->getParameters($event);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg')));
+
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/tag.svg')));
+ }
if ($event->getSubject() === self::CREATE_TAG) {
if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
use InvalidArgumentException;
use OCP\Activity\IEvent;
+use OCP\Activity\IManager;
use OCP\Activity\IProvider;
-use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\L10N\IFactory as L10nFactory;
/** @var IURLGenerator */
private $urlGenerator;
- /** @var ILogger */
- private $logger;
+ /** @var IManager */
+ private $activityManager;
/**
* @param L10nFactory $l10n
* @param IURLGenerator $urlGenerator
- * @param ILogger $logger
+ * @param IManager $activityManager
*/
- public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, ILogger $logger) {
- $this->logger = $logger;
+ public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, IManager $activityManager) {
$this->urlGenerator = $urlGenerator;
+ $this->activityManager = $activityManager;
$this->l10n = $l10n;
}
switch ($event->getSubject()) {
case 'codes_generated':
$event->setParsedSubject($l->t('You created two-factor backup codes for your account'));
- $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png')));
+ } else {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+ }
break;
default:
throw new InvalidArgumentException();
namespace OC\Settings\Activity;
use OCP\Activity\IEvent;
+use OCP\Activity\IManager;
use OCP\Activity\IProvider;
use OCP\IL10N;
use OCP\IURLGenerator;
/** @var IUserManager */
protected $userManager;
+ /** @var IManager */
+ private $activityManager;
+
/** @var string[] cached displayNames - key is the UID and value the displayname */
protected $displayNames = [];
* @param IFactory $languageFactory
* @param IURLGenerator $url
* @param IUserManager $userManager
+ * @param IManager $activityManager
*/
- public function __construct(IFactory $languageFactory, IURLGenerator $url, IUserManager $userManager) {
+ public function __construct(IFactory $languageFactory, IURLGenerator $url, IUserManager $userManager, IManager $activityManager) {
$this->languageFactory = $languageFactory;
$this->url = $url;
$this->userManager = $userManager;
+ $this->activityManager = $activityManager;
}
/**
$this->l = $this->languageFactory->get('settings', $language);
- $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('settings', 'personal.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('settings', 'personal.png')));
+ } else {
+ $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('settings', 'personal.svg')));
+ }
if ($event->getSubject() === self::PASSWORD_CHANGED_BY) {
$subject = $this->l->t('{actor} changed your password');
use InvalidArgumentException;
use OCP\Activity\IEvent;
+use OCP\Activity\IManager;
use OCP\Activity\IProvider;
-use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\L10N\IFactory as L10nFactory;
/** @var IURLGenerator */
private $urlGenerator;
- /** @var ILogger */
- private $logger;
+ /** @var IManager */
+ private $activityManager;
- public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, ILogger $logger) {
- $this->logger = $logger;
+ public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, IManager $activityManager) {
$this->urlGenerator = $urlGenerator;
$this->l10n = $l10n;
+ $this->activityManager = $activityManager;
}
public function parse($language, IEvent $event, IEvent $previousEvent = null) {
$event->setParsedSubject($l->t('You successfully logged in using two-factor authentication (%1$s)', [
$params['provider'],
]));
- $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png')));
+ } else {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+ }
break;
case 'twofactor_failed':
$params = $event->getSubjectParameters();
$event->setParsedSubject($l->t('A login attempt using two-factor authentication failed (%1$s)', [
$params['provider'],
]));
- $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png')));
+ } else {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+ }
break;
default:
throw new InvalidArgumentException();