Skip to content

Commit

Permalink
Fix flagging check for all post types
Browse files Browse the repository at this point in the history
Refs #18.
  • Loading branch information
franzliedke committed Feb 7, 2020
1 parent 2760213 commit ffa8108
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Listener/AddFlagsApiAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Api\Serializer\PostSerializer;
use Flarum\Flags\Flag;
use Flarum\Post\CommentPost;
use Flarum\Post\Post;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\User;

Expand Down Expand Up @@ -78,12 +78,7 @@ protected function getNewFlagCount(User $actor)
return $query->distinct()->count('flags.post_id');
}

/**
* @param User $actor
* @param CommentPost $post
* @return bool
*/
protected function checkFlagOwnPostSetting(User $actor, CommentPost $post): bool
protected function checkFlagOwnPostSetting(User $actor, Post $post): bool
{
if ($actor->id === $post->user_id) {
// If $actor is the post author, check to see if the setting is enabled
Expand Down

0 comments on commit ffa8108

Please sign in to comment.