mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 08:54:08 +08:00
parent
4ec12da827
commit
beb5329e42
@ -14,7 +14,7 @@ use Flarum\Api\Serializer\CurrentUserSerializer;
|
|||||||
use Flarum\Api\Serializer\ForumSerializer;
|
use Flarum\Api\Serializer\ForumSerializer;
|
||||||
use Flarum\Api\Serializer\PostSerializer;
|
use Flarum\Api\Serializer\PostSerializer;
|
||||||
use Flarum\Flags\Flag;
|
use Flarum\Flags\Flag;
|
||||||
use Flarum\Post\CommentPost;
|
use Flarum\Post\Post;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
|
|
||||||
@ -78,12 +78,7 @@ class AddFlagsApiAttributes
|
|||||||
return $query->distinct()->count('flags.post_id');
|
return $query->distinct()->count('flags.post_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected function checkFlagOwnPostSetting(User $actor, Post $post): bool
|
||||||
* @param User $actor
|
|
||||||
* @param CommentPost $post
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
protected function checkFlagOwnPostSetting(User $actor, CommentPost $post): bool
|
|
||||||
{
|
{
|
||||||
if ($actor->id === $post->user_id) {
|
if ($actor->id === $post->user_id) {
|
||||||
// If $actor is the post author, check to see if the setting is enabled
|
// If $actor is the post author, check to see if the setting is enabled
|
||||||
|
Loading…
x
Reference in New Issue
Block a user