Check access before send Mention notification

This commit is contained in:
Sajjad Hasehmian 2016-03-04 13:53:15 +03:30
parent ec3db146fc
commit 6f39123bad

View File

@ -130,7 +130,7 @@ class UpdateUserMentionsMetadata
$users = User::whereIn('id', $mentioned)
->get()
->filter(function ($user) use ($post) {
return $user->id !== $post->user->id;
return $post->isVisibleTo($user) && $user->id !== $post->user->id;
})
->all();