From fa123bd765ee3f7731ce041da7d4ede7c673b9c0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 2 Nov 2022 20:28:53 -0400 Subject: [PATCH] Rename Repository\Notify->NotifyOnDesktop to shouldShowOnDesktop - New name better reflect the behavior --- src/Model/Subscription.php | 2 +- src/Module/Notifications/Ping.php | 2 +- src/Navigation/Notifications/Repository/Notify.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index 2796b37a0..88aa82067 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -141,7 +141,7 @@ class Subscription { $type = NotificationFactory::getType($notification); - if (DI::notify()->NotifyOnDesktop($notification, $type)) { + if (DI::notify()->shouldShowOnDesktop($notification, $type)) { DI::notify()->createFromNotification($notification); } diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php index a0fe8e9ae..3838c0e15 100644 --- a/src/Module/Notifications/Ping.php +++ b/src/Module/Notifications/Ping.php @@ -190,7 +190,7 @@ class Ping extends BaseModule $owner = User::getOwnerDataById(DI::userSession()->getLocalUserId()); $navNotifications = array_map(function (Entity\Notification $notification) use ($owner) { - if (!DI::notify()->NotifyOnDesktop($notification)) { + if (!DI::notify()->shouldShowOnDesktop($notification)) { return null; } if (($notification->type == Post\UserNotification::TYPE_NONE) && in_array($owner['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP])) { diff --git a/src/Navigation/Notifications/Repository/Notify.php b/src/Navigation/Notifications/Repository/Notify.php index 5ed62c8c3..52c51fcb8 100644 --- a/src/Navigation/Notifications/Repository/Notify.php +++ b/src/Navigation/Notifications/Repository/Notify.php @@ -664,7 +664,7 @@ class Notify extends BaseRepository return false; } - public function NotifyOnDesktop(Entity\Notification $Notification, string $type = null): bool + public function shouldShowOnDesktop(Entity\Notification $Notification, string $type = null): bool { if (is_null($type)) { $type = NotificationFactory::getType($Notification);