summaryrefslogtreecommitdiffstats
path: root/apps/settings/lib
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2022-12-19 10:46:39 +0100
committerGitHub <noreply@github.com>2022-12-19 10:46:39 +0100
commitcbbb0712db0f33a41ef66ae59d5c70ba1e23748f (patch)
treedb09b311f4a6a62451dd25db25ae9f8e80a3064c /apps/settings/lib
parent884da19198d15a764487e6a6d615968c0e63203d (diff)
parente553cd1bb9cec6bf6200298bcca6637e81163953 (diff)
downloadnextcloud-server-cbbb0712db0f33a41ef66ae59d5c70ba1e23748f.tar.gz
nextcloud-server-cbbb0712db0f33a41ef66ae59d5c70ba1e23748f.zip
Merge pull request #34807 from nextcloud/fix/compute-notification-parsed-subject
Compute notification parsed subject from rich subject when possible
Diffstat (limited to 'apps/settings/lib')
-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 {