镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix checking for links finally - #1276

Merged
nickvergessen merged 1 commit into
masterfrom
bugfix/noid/fix-checking-for-links
Sep 20, 2022
Merged

nickvergessen merged 1 commit into
masterfrom
bugfix/noid/fix-checking-for-links

Conversation

@nickvergessen

Copy link
Copy Markdown
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
Copy Markdown
Member Author

/backport to stable24

@nickvergessen

Copy link
Copy Markdown
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