diff --git a/src/Controller/Feeds.php b/src/Controller/Feeds.php index 00f9116df5..938aa58de7 100644 --- a/src/Controller/Feeds.php +++ b/src/Controller/Feeds.php @@ -36,7 +36,6 @@ declare(strict_types = 1); namespace App\Controller; use function App\Core\I18n\_m; -use App\Core\VisibilityScope; use App\Util\Common; use Component\Feed\Feed; use Component\Feed\Util\FeedController; @@ -55,9 +54,9 @@ class Feeds extends FeedController language: Common::actor()?->getTopLanguage()?->getLocale(), ); return [ - '_template' => 'feed/feed.html.twig', - 'page_title' => _m(\is_null(Common::user()) ? 'Feed' : 'Planet'), - 'notes' => $data['notes'], + '_template' => 'feed/feed.html.twig', + 'page_title' => _m(\is_null(Common::user()) ? 'Feed' : 'Planet'), + 'notes' => $data['notes'], ]; } @@ -74,9 +73,9 @@ class Feeds extends FeedController actor: Common::actor(), ); return [ - '_template' => 'feed/feed.html.twig', - 'page_title' => _m('Home'), - 'notes' => $data['notes'], + '_template' => 'feed/feed.html.twig', + 'page_title' => _m('Home'), + 'notes' => $data['notes'], ]; } } diff --git a/src/DataFixtures/CoreFixtures.php b/src/DataFixtures/CoreFixtures.php index cf622bde0a..a515090e68 100644 --- a/src/DataFixtures/CoreFixtures.php +++ b/src/DataFixtures/CoreFixtures.php @@ -46,7 +46,7 @@ class CoreFixtures extends Fixture $manager->persist($n); $notes = []; $notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'some other content', 'content_type' => 'text/plain', 'is_local' => true]); - $notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'private note', 'scope' => VisibilityScope::SUBSCRIBER, 'content_type' => 'text/plain', 'is_local' => false]); + $notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'private note', 'scope' => VisibilityScope::COLLECTION, 'content_type' => 'text/plain', 'is_local' => false]); $notes[] = $group_note = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'group note', 'scope' => VisibilityScope::GROUP, 'content_type' => 'text/plain', 'is_local' => true]); foreach ($notes as $note) { $manager->persist($note); diff --git a/tests/Entity/NoteTest.php b/tests/Entity/NoteTest.php index a91cfefb96..a55b2f80ae 100644 --- a/tests/Entity/NoteTest.php +++ b/tests/Entity/NoteTest.php @@ -52,7 +52,7 @@ class NoteTest extends GNUsocialTestCase $actor2 = DB::findOneBy('actor', ['nickname' => 'taken_group']); $actor3 = DB::findOneBy('actor', ['nickname' => 'some_user']); - $note_visible_to_1 = DB::findBy('note', ['actor_id' => $actor1->getId(), 'content' => 'private note', 'scope' => VisibilityScope::SUBSCRIBER], limit: 1)[0]; + $note_visible_to_1 = DB::findBy('note', ['actor_id' => $actor1->getId(), 'content' => 'private note', 'scope' => VisibilityScope::COLLECTION], limit: 1)[0]; static::assertTrue($note_visible_to_1->isVisibleTo($actor1)); static::assertFalse($note_visible_to_1->isVisibleTo($actor2)); static::assertFalse($note_visible_to_1->isVisibleTo($actor3));