Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checking for links finally #1276

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

nickvergessen
Copy link
Member

Fix nextcloud/server#30836

Steps for testing:

  1. Send an admin notification: occ notification:generate admin admin
  2. Apply this patch:
diff --git a/lib/Notifier/AdminNotifications.php b/lib/Notifier/AdminNotifications.php
index 5227c0b..67923bd 100644
--- a/lib/Notifier/AdminNotifications.php
+++ b/lib/Notifier/AdminNotifications.php
@@ -89,7 +89,17 @@ class AdminNotifications implements INotifier {
                                        $notification->setParsedMessage($messageParams[0]);
                                }
 
+                       $notification->setParsedSubject($this->l10nFactory->get('notifications')->t('Update for %1$s to version %2$s is available.', ['$appName', $notification->getObjectId()]))
+                               ->setRichSubject($this->l10nFactory->get('notifications')->t('Update for {app} to version %s is available.', [$notification->getObjectId()]), [
+                                       'app' => [
+                                               'type' => 'highlight',
+                                               'id' => $notification->getObjectType(),
+                                               'name' => '$appName',
+                                       ]
+                               ]);
+
                                $notification->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('notifications', 'notifications-dark.svg')));
+                               $notification->setLink('https://nextcloud25.local/index.php/settings/admin/overview');
                                return $notification;
 
                        default:

Before

💥 Subject is not clickable

After

✨ Subject is clickable

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen merged commit 3a3e18a into master Sep 20, 2022
@nickvergessen nickvergessen deleted the bugfix/noid/fix-checking-for-links branch September 20, 2022 07:06
@nickvergessen
Copy link
Member Author

/backport to stable24

@nickvergessen
Copy link
Member Author

/backport to stable23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking an app update notification should open app updates
2 participants