Skip to content

Commit

Permalink
Merge branch 'develop' into dev-ks/php84
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Nov 15, 2024
2 parents 1829d60 + 5033cce commit 67522a9
Show file tree
Hide file tree
Showing 10 changed files with 415 additions and 340 deletions.
1 change: 1 addition & 0 deletions app/Http/Resources/UserBaseResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function toArray($request): array {
'muted' => (bool) $this->muted,
'following' => (bool) $this->following,
'followPending' => (bool) $this->followPending,
'followedBy' => (bool) $this->followedBy,
])
];
}
Expand Down
4 changes: 4 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ public function getMutedAttribute(): bool {
return auth()->check() && auth()->user()->mutedUsers->contains('id', $this->id);
}

public function getFollowedByAttribute(): bool {
return (auth()->check() && $this->followings->contains('follow_id', auth()->user()->id));
}

/**
* The auth-user is blocked by $this user. auth-user can not see $this's statuses.
*/
Expand Down
12 changes: 12 additions & 0 deletions app/Virtual/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ class User
*/
private $followPending;

/**
* @OA\Property (
* title="followedBy",
* description="Is the user following you?",
* type="boolean",
* example=false
* )
*
* @var bool
*/
private $followedBy;

/**
* @OA\Property (
* title="preventIndex",
Expand Down
Loading

0 comments on commit 67522a9

Please sign in to comment.