1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Use a notification driver with the new channel extender (#28)

This commit is contained in:
Sami Mazouz
2020-11-05 18:09:13 +01:00
committed by GitHub
parent 1c63326ad5
commit bf6dd3083d
4 changed files with 92 additions and 39 deletions

View File

@@ -9,10 +9,10 @@
use Flarum\Api\Event\Serializing;
use Flarum\Extend;
use Flarum\Notification\Event\Sending;
use Flarum\Post\Event\Posted;
use Flarum\Pusher\Api\Controller\AuthController;
use Flarum\Pusher\Listener;
use Flarum\Pusher\PusherNotificationDriver;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
@@ -30,6 +30,9 @@ return [
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Notification())
->driver('pusher', PusherNotificationDriver::class),
function (Dispatcher $events, Container $container) {
$container->bind(Pusher::class, function ($app) {
$settings = $app->make(SettingsRepositoryInterface::class);
@@ -49,7 +52,6 @@ return [
});
$events->listen(Posted::class, Listener\PushNewPost::class);
$events->listen(Sending::class, Listener\PushNotification::class);
$events->listen(Serializing::class, Listener\AddPusherApi::class);
},
];