From dc5bdfa1fb6992e410811a47b4c98350fee660c9 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 15 Apr 2021 22:26:05 +0000 Subject: [PATCH] [CORE] Rename NoteScope to VisibilityScope, as it will be used for attachment visbility too --- src/Controller/Network.php | 10 +++++----- src/Controller/Security.php | 6 +++--- src/Core/{NoteScope.php => VisibilityScope.php} | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/Core/{NoteScope.php => VisibilityScope.php} (96%) diff --git a/src/Controller/Network.php b/src/Controller/Network.php index c99a365716..c84601b86e 100644 --- a/src/Controller/Network.php +++ b/src/Controller/Network.php @@ -37,7 +37,7 @@ use App\Core\Controller; use App\Core\DB\DB; use App\Core\Event; use function App\Core\I18n\_m; -use App\Core\NoteScope; +use App\Core\VisibilityScope; use App\Entity\Note; use App\Util\Common; use App\Util\Exception\ClientException; @@ -46,10 +46,10 @@ use Symfony\Component\HttpFoundation\Request; class Network extends Controller { // Can't have constanst inside herestring - private $public_scope = NoteScope::PUBLIC; - private $instance_scope = NoteScope::PUBLIC | NoteScope::SITE; - private $message_scope = NoteScope::MESSAGE; - private $follower_scope = NoteScope::PUBLIC | NoteScope::FOLLOWER; + private $public_scope = VisibilityScope::PUBLIC; + private $instance_scope = VisibilityScope::PUBLIC | VisibilityScope::SITE; + private $message_scope = VisibilityScope::MESSAGE; + private $follower_scope = VisibilityScope::PUBLIC | VisibilityScope::FOLLOWER; public function public(Request $request) { diff --git a/src/Controller/Security.php b/src/Controller/Security.php index 51fa820100..eb330d53c3 100644 --- a/src/Controller/Security.php +++ b/src/Controller/Security.php @@ -6,7 +6,7 @@ use App\Core\Controller; use App\Core\DB\DB; use App\Core\Form; use function App\Core\I18n\_m; -use App\Core\NoteScope; +use App\Core\VisibilityScope; use App\Entity\Follow; use App\Entity\GSActor; use App\Entity\LocalUser; @@ -43,7 +43,7 @@ class Security extends Controller // last username entered by the user $last_username = $authenticationUtils->getLastUsername(); - return ['_template' => 'security/login.html.twig', 'last_username' => $last_username, 'error' => $error, 'notes' => Note::getAllNotes(NoteScope::$instance_scope)]; + return ['_template' => 'security/login.html.twig', 'last_username' => $last_username, 'error' => $error, 'notes' => Note::getAllNotes(VisibilityScope::$instance_scope)]; } public function logout() @@ -139,7 +139,7 @@ class Security extends Controller return [ '_template' => 'security/register.html.twig', 'registration_form' => $form->createView(), - 'notes' => Note::getAllNotes(NoteScope::$instance_scope), + 'notes' => Note::getAllNotes(VisibilityScope::$instance_scope), ]; } } diff --git a/src/Core/NoteScope.php b/src/Core/VisibilityScope.php similarity index 96% rename from src/Core/NoteScope.php rename to src/Core/VisibilityScope.php index bd4a0bdb1f..e2c854646e 100644 --- a/src/Core/NoteScope.php +++ b/src/Core/VisibilityScope.php @@ -21,7 +21,7 @@ namespace App\Core; use App\Util\Bitmap; -class NoteScope extends Bitmap +class VisibilityScope extends Bitmap { public const PUBLIC = 1; public const SITE = 2;