From b8e259f75dfa52584d7483313b0c6814867d2330 Mon Sep 17 00:00:00 2001 From: winter Date: Mon, 20 Jan 2025 18:20:45 +0000 Subject: follow, unfollow, follow request notifications --- Digitigrade/Model/Actor.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Digitigrade/Model/Actor.php') diff --git a/Digitigrade/Model/Actor.php b/Digitigrade/Model/Actor.php index d04c841..b4e9392 100644 --- a/Digitigrade/Model/Actor.php +++ b/Digitigrade/Model/Actor.php @@ -1,6 +1,8 @@ requestToFollow ? FollowRelationStatus::PENDING : FollowRelationStatus::ACTIVE; - FollowRelation::create($args[0], $this, $status); + $rel = FollowRelation::create($args[0], $this, $status); + $rel->processNotifications(); return $status; case 'unfollow': FollowRelation::findByActors($args[0], $this)->remove(); + (new UnfollowNotif($args[0], $this))->processNotifications(); return; case 'acceptedFollow': $rel = FollowRelation::findByActors($this, $args[0]); $rel->status = FollowRelationStatus::ACTIVE; $rel->save(); + $rel->processNotifications(); + (new PendingFollowActionedNotif($args[0], $this, 'accept'))->processNotifications(); return; case 'rejectedFollow': FollowRelation::findByActors($this, $args[0])->remove(); + (new PendingFollowActionedNotif($args[0], $this, 'reject'))->processNotifications(); return; default: -- cgit v1.3