Compute notification parsed subject from rich subject when possible#34807
Compute notification parsed subject from rich subject when possible#34807
Conversation
|
Could you please elaborate on the problem and the solution? :) |
| if ($subjectParameters['actor'] === $this->activityManager->getCurrentUserId()) { | ||
| $event->setParsedSubject($this->l->t('You commented')) | ||
| ->setRichSubject($this->l->t('You commented'), []); | ||
| $event->setRichSubject($this->l->t('You commented'), []); |
Check notice
Code scanning / Psalm
PossiblyNullReference
| ->setRichSubject($this->l->t('{author} commented'), [ | ||
| 'author' => $author, | ||
| ]); | ||
| $event->setRichSubject($this->l->t('{author} commented'), [ |
Check notice
Code scanning / Psalm
PossiblyNullReference
Both activity event and notification expects applications to give both a rich subject and a parsed subject, and same thing for message. Also, when doing this: Two strings are created for translators to translate, while they contain the same translatable text. This PR attempts to remove the duplicated code and strings by providing a suitable fallback in notification and activity event directly. |
|
(putting this back to developing, I’ll look into Joas feedback and special cases next week) |
|
/rebase |
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…ect is able to do it Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
5ce21e5 to
8a04bf5
Compare
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
|
@CarlSchwan @ChristophWurst @miaulalala I need a codeowner approval here 🙏 |
|
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
|
hello @come-nc , |
Let’s avoid duplicated code and translation strings and ease application developpers lives.