mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Removes AssertPermissionTrait (#29)
* Removes AssertPermissionTrait * Apply fixes from StyleCI * Fix my dumb mistake Co-authored-by: luceos <daniel+github@klabbers.email>
This commit is contained in:
parent
2648ee2031
commit
1fe034460b
|
@ -10,18 +10,15 @@
|
|||
namespace Flarum\Subscriptions\Listener;
|
||||
|
||||
use Flarum\Post\Event\Posted;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
|
||||
class FollowAfterReply
|
||||
{
|
||||
use AssertPermissionTrait;
|
||||
|
||||
public function handle(Posted $event)
|
||||
{
|
||||
$actor = $event->actor;
|
||||
|
||||
if ($actor && $actor->exists && $actor->getPreference('followAfterReply')) {
|
||||
$this->assertRegistered($actor);
|
||||
$actor->assertRegistered();
|
||||
|
||||
$state = $event->post->discussion->stateFor($actor);
|
||||
|
||||
|
|
|
@ -10,12 +10,9 @@
|
|||
namespace Flarum\Subscriptions\Listener;
|
||||
|
||||
use Flarum\Discussion\Event\Saving;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
|
||||
class SaveSubscriptionToDatabase
|
||||
{
|
||||
use AssertPermissionTrait;
|
||||
|
||||
public function handle(Saving $event)
|
||||
{
|
||||
$discussion = $event->discussion;
|
||||
|
@ -25,7 +22,7 @@ class SaveSubscriptionToDatabase
|
|||
$actor = $event->actor;
|
||||
$subscription = $data['attributes']['subscription'];
|
||||
|
||||
$this->assertRegistered($actor);
|
||||
$actor->assertRegistered();
|
||||
|
||||
$state = $discussion->stateFor($actor);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user