1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 07:41:22 +02:00

Merge pull request #12 from CDK2020/master

Update for beta 8
This commit is contained in:
Franz Liedke
2017-09-05 08:32:13 +02:00
committed by GitHub
3 changed files with 17 additions and 17 deletions

View File

@@ -11,7 +11,7 @@
namespace Flarum\Pusher\Listener;
use Flarum\Event\ConfigureWebApp;
use Flarum\Frontend\Event\Rendering;
use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets
@@ -21,13 +21,13 @@ class AddClientAssets
*/
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
$events->listen(Rendering::class, [$this, 'addAssets']);
}
/**
* @param ConfigureClientView $event
* @param Rendering $event
*/
public function addAssets(ConfigureWebApp $event)
public function addAssets(Rendering $event)
{
if ($event->isForum()) {
$event->addAssets([

View File

@@ -11,9 +11,9 @@
namespace Flarum\Pusher\Listener;
use Flarum\Api\Event\Serializing;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Event\ConfigureApiRoutes;
use Flarum\Event\PrepareApiAttributes;
use Flarum\Pusher\Api\Controller\AuthController;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
@@ -38,14 +38,14 @@ class AddPusherApi
*/
public function subscribe(Dispatcher $events)
{
$events->listen(PrepareApiAttributes::class, [$this, 'addAttributes']);
$events->listen(Serializing::class, [$this, 'addAttributes']);
$events->listen(ConfigureApiRoutes::class, [$this, 'addRoutes']);
}
/**
* @param PrepareApiAttributes $event
* @param Serializing $event
*/
public function addAttributes(PrepareApiAttributes $event)
public function addAttributes(Serializing $event)
{
if ($event->isSerializer(ForumSerializer::class)) {
$event->attributes['pusherKey'] = $this->settings->get('flarum-pusher.app_key');

View File

@@ -11,10 +11,10 @@
namespace Flarum\Pusher\Listener;
use Flarum\Core\Guest;
use Flarum\Event\NotificationWillBeSent;
use Flarum\Event\PostWasPosted;
use Flarum\Notification\Event\Sending;
use Flarum\Post\Event\Posted;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\Guest;
use Illuminate\Contracts\Events\Dispatcher;
use Pusher;
@@ -38,14 +38,14 @@ class PushNewPosts
*/
public function subscribe(Dispatcher $events)
{
$events->listen(PostWasPosted::class, [$this, 'pushNewPost']);
$events->listen(NotificationWillBeSent::class, [$this, 'pushNotification']);
$events->listen(Posted::class, [$this, 'pushNewPost']);
$events->listen(Sending::class, [$this, 'pushNotification']);
}
/**
* @param PostWasPosted $event
* @param Posted $event
*/
public function pushNewPost(PostWasPosted $event)
public function pushNewPost(Posted $event)
{
if ($event->post->isVisibleTo(new Guest)) {
$pusher = $this->getPusher();
@@ -59,9 +59,9 @@ class PushNewPosts
}
/**
* @param NotificationWillBeSent $event
* @param Sending $event
*/
public function pushNotification(NotificationWillBeSent $event)
public function pushNotification(Sending $event)
{
$pusher = $this->getPusher();
$blueprint = $event->blueprint;