mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
@@ -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
|
||||||
|
Reference in New Issue
Block a user