summaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-10-25 17:16:54 +0200
committerCôme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com>2022-11-29 14:36:29 +0000
commitd9151ff35c4280b8e5bbb92e33fe2b89c2bee458 (patch)
treec0b5864c0c667156b82763382b4541d1fa073d37 /apps/settings
parentdb995d464d06ace8231c41633287ce689b7d33b1 (diff)
downloadnextcloud-server-d9151ff35c4280b8e5bbb92e33fe2b89c2bee458.tar.gz
nextcloud-server-d9151ff35c4280b8e5bbb92e33fe2b89c2bee458.zip
Get rid of all useless calls to setParsedSubject now that setRichSubject is able to do it
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/Activity/GroupProvider.php13
-rw-r--r--apps/settings/lib/Activity/Provider.php13
2 files changed, 2 insertions, 24 deletions
diff --git a/apps/settings/lib/Activity/GroupProvider.php b/apps/settings/lib/Activity/GroupProvider.php
index 466bb9abeee..52798d2e428 100644
--- a/apps/settings/lib/Activity/GroupProvider.php
+++ b/apps/settings/lib/Activity/GroupProvider.php
@@ -30,7 +30,6 @@ use OCP\Activity\IProvider;
use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IURLGenerator;
-use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory as L10nFactory;
@@ -123,20 +122,10 @@ class GroupProvider implements IProvider {
}
/**
- * @param IEvent $event
- * @param string $subject
- * @param array $parameters
* @throws \InvalidArgumentException
*/
protected function setSubjects(IEvent $event, string $subject, array $parameters): void {
- $placeholders = $replacements = [];
- foreach ($parameters as $placeholder => $parameter) {
- $placeholders[] = '{' . $placeholder . '}';
- $replacements[] = $parameter['name'];
- }
-
- $event->setParsedSubject(str_replace($placeholders, $replacements, $subject))
- ->setRichSubject($subject, $parameters);
+ $event->setRichSubject($subject, $parameters);
}
/**
diff --git a/apps/settings/lib/Activity/Provider.php b/apps/settings/lib/Activity/Provider.php
index 7d8a7f0da9a..85ebd3e2abd 100644
--- a/apps/settings/lib/Activity/Provider.php
+++ b/apps/settings/lib/Activity/Provider.php
@@ -33,7 +33,6 @@ use OCP\Activity\IManager;
use OCP\Activity\IProvider;
use OCP\IL10N;
use OCP\IURLGenerator;
-use OCP\IUser;
use OCP\IUserManager;
use OCP\L10N\IFactory;
@@ -186,20 +185,10 @@ class Provider implements IProvider {
}
/**
- * @param IEvent $event
- * @param string $subject
- * @param array $parameters
* @throws \InvalidArgumentException
*/
protected function setSubjects(IEvent $event, string $subject, array $parameters): void {
- $placeholders = $replacements = [];
- foreach ($parameters as $placeholder => $parameter) {
- $placeholders[] = '{' . $placeholder . '}';
- $replacements[] = $parameter['name'];
- }
-
- $event->setParsedSubject(str_replace($placeholders, $replacements, $subject))
- ->setRichSubject($subject, $parameters);
+ $event->setRichSubject($subject, $parameters);
}
protected function generateUserParameter(string $uid): array {