[CORE] Rename NoteScope to VisibilityScope, as it will be used for attachment visbility too

This commit is contained in:
Hugo Sales 2021-04-15 22:26:05 +00:00 committed by Diogo Peralta Cordeiro
parent 1fda65bc3d
commit d6414e51a2
3 changed files with 9 additions and 9 deletions

View File

@ -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)
{

View File

@ -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),
];
}
}

View File

@ -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;