[ENTITY] Refactor Follow as Subscription

This commit is contained in:
2021-11-08 13:44:35 +00:00
parent 68c6dd1ba9
commit f98afd15ce
16 changed files with 136 additions and 136 deletions

View File

@@ -12,7 +12,7 @@ use function App\Core\I18n\_m;
use App\Core\Log;
use App\Core\VisibilityScope;
use App\Entity\Actor;
use App\Entity\Follow;
use App\Entity\Subscription;
use App\Entity\LocalUser;
use App\Entity\Note;
use App\Security\Authenticator;
@@ -145,8 +145,8 @@ class Security extends Controller
DB::persistWithSameId(
$actor,
$user,
// Self follow
fn (int $id) => DB::persist(Follow::create(['follower' => $id, 'followed' => $id])),
// Self subscription
fn (int $id) => DB::persist(Subscription::create(['subscriber' => $id, 'subscribed' => $id])),
);
Event::handle('SuccessfulLocalUserRegistration', [$actor, $user]);