mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Update for beta 8
This commit is contained in:
parent
64d349a5b6
commit
60ea08c846
@ -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([
|
||||
|
@ -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');
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user