From 09642da8cc248b4c88f50bdbbcaff28a357fd099 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Feb 2019 13:15:59 +0100 Subject: Use rich object subjects Signed-off-by: Joas Schilling --- settings/Activity/Provider.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'settings/Activity') diff --git a/settings/Activity/Provider.php b/settings/Activity/Provider.php index 68606b80739..4debf1210ce 100644 --- a/settings/Activity/Provider.php +++ b/settings/Activity/Provider.php @@ -111,11 +111,11 @@ class Provider implements IProvider { $subject = $this->l->t('Your email address was changed by an administrator'); } else if ($event->getSubject() === self::APP_TOKEN_CREATED) { - $subject = $this->l->t('You created app password "%1$s"', $event->getSubjectParameters()); + $subject = $this->l->t('You created app password "{token}"'); } else if ($event->getSubject() === self::APP_TOKEN_UPDATED) { - $subject = $this->l->t('You updated app password "%1$s"', $event->getSubjectParameters()); + $subject = $this->l->t('You updated app password "{token}"'); } else if ($event->getSubject() === self::APP_TOKEN_DELETED) { - $subject = $this->l->t('You deleted app password "%1$s"', $event->getSubjectParameters()); + $subject = $this->l->t('You deleted app password "{token}"'); } else { throw new \InvalidArgumentException(); @@ -141,15 +141,22 @@ class Provider implements IProvider { case self::PASSWORD_RESET: case self::EMAIL_CHANGED_SELF: case self::EMAIL_CHANGED: - case self::APP_TOKEN_CREATED: - case self::APP_TOKEN_UPDATED: - case self::APP_TOKEN_DELETED: return []; case self::PASSWORD_CHANGED_BY: case self::EMAIL_CHANGED_BY: return [ 'actor' => $this->generateUserParameter($parameters[0]), ]; + case self::APP_TOKEN_CREATED: + case self::APP_TOKEN_UPDATED: + case self::APP_TOKEN_DELETED: + return [ + 'token' => [ + 'type' => 'highlight', + 'id' => $event->getObjectId(), + 'name' => $parameters[0], + ] + ]; } throw new \InvalidArgumentException(); -- cgit v1.2.3