1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Add suspended gambit (#23)

* Add is:suspended gambit

* Wrap where clauses in function

* Added permission check for suspended gambit

* Apply fixes from StyleCI

Co-authored-by: luceos <daniel+github@klabbers.email>
This commit is contained in:
Alexander Skvortsov
2020-06-28 15:02:09 -04:00
committed by GitHub
parent c925f92f79
commit 061a8585c2
2 changed files with 74 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
use Flarum\Api\Serializer\BasicUserSerializer;
use Flarum\Event\ConfigureNotificationTypes;
use Flarum\Event\ConfigureUserGambits;
use Flarum\Extend;
use Flarum\Suspend\Access;
use Flarum\Suspend\Event\Suspended;
@@ -16,6 +17,7 @@ use Flarum\Suspend\Event\Unsuspended;
use Flarum\Suspend\Listener;
use Flarum\Suspend\Notification\UserSuspendedBlueprint;
use Flarum\Suspend\Notification\UserUnsuspendedBlueprint;
use Flarum\Suspend\Search\Gambit\SuspendedGambit;
use Flarum\User\Event\Saving;
use Flarum\User\User;
use Illuminate\Contracts\Events\Dispatcher;
@@ -48,5 +50,9 @@ return [
$events->listen(Unsuspended::class, Listener\SendNotificationWhenUserIsUnsuspended::class);
$events->subscribe(Access\UserPolicy::class);
$events->listen(ConfigureUserGambits::class, function (ConfigureUserGambits $event) {
$event->gambits->add(SuspendedGambit::class);
});
}
];