mirror of
https://github.com/flarum/core.git
synced 2025-07-20 08:11:27 +02:00
Update for beta 8
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Flarum\Pusher\Listener;
|
namespace Flarum\Pusher\Listener;
|
||||||
|
|
||||||
use Flarum\Event\ConfigureWebApp;
|
use Flarum\Frontend\Event\Rendering;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
|
||||||
class AddClientAssets
|
class AddClientAssets
|
||||||
@@ -21,13 +21,13 @@ class AddClientAssets
|
|||||||
*/
|
*/
|
||||||
public function subscribe(Dispatcher $events)
|
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()) {
|
if ($event->isForum()) {
|
||||||
$event->addAssets([
|
$event->addAssets([
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
namespace Flarum\Pusher\Listener;
|
namespace Flarum\Pusher\Listener;
|
||||||
|
|
||||||
|
use Flarum\Api\Event\Serializing;
|
||||||
use Flarum\Api\Serializer\ForumSerializer;
|
use Flarum\Api\Serializer\ForumSerializer;
|
||||||
use Flarum\Event\ConfigureApiRoutes;
|
use Flarum\Event\ConfigureApiRoutes;
|
||||||
use Flarum\Event\PrepareApiAttributes;
|
|
||||||
use Flarum\Pusher\Api\Controller\AuthController;
|
use Flarum\Pusher\Api\Controller\AuthController;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
@@ -38,14 +38,14 @@ class AddPusherApi
|
|||||||
*/
|
*/
|
||||||
public function subscribe(Dispatcher $events)
|
public function subscribe(Dispatcher $events)
|
||||||
{
|
{
|
||||||
$events->listen(PrepareApiAttributes::class, [$this, 'addAttributes']);
|
$events->listen(Serializing::class, [$this, 'addAttributes']);
|
||||||
$events->listen(ConfigureApiRoutes::class, [$this, 'addRoutes']);
|
$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)) {
|
if ($event->isSerializer(ForumSerializer::class)) {
|
||||||
$event->attributes['pusherKey'] = $this->settings->get('flarum-pusher.app_key');
|
$event->attributes['pusherKey'] = $this->settings->get('flarum-pusher.app_key');
|
||||||
|
@@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
namespace Flarum\Pusher\Listener;
|
namespace Flarum\Pusher\Listener;
|
||||||
|
|
||||||
use Flarum\Core\Guest;
|
use Flarum\Notification\Event\Sending;
|
||||||
use Flarum\Event\NotificationWillBeSent;
|
use Flarum\Post\Event\Posted;
|
||||||
use Flarum\Event\PostWasPosted;
|
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
|
use Flarum\User\Guest;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
use Pusher;
|
use Pusher;
|
||||||
|
|
||||||
@@ -38,14 +38,14 @@ class PushNewPosts
|
|||||||
*/
|
*/
|
||||||
public function subscribe(Dispatcher $events)
|
public function subscribe(Dispatcher $events)
|
||||||
{
|
{
|
||||||
$events->listen(PostWasPosted::class, [$this, 'pushNewPost']);
|
$events->listen(Posted::class, [$this, 'pushNewPost']);
|
||||||
$events->listen(NotificationWillBeSent::class, [$this, 'pushNotification']);
|
$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)) {
|
if ($event->post->isVisibleTo(new Guest)) {
|
||||||
$pusher = $this->getPusher();
|
$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();
|
$pusher = $this->getPusher();
|
||||||
$blueprint = $event->blueprint;
|
$blueprint = $event->blueprint;
|
||||||
|
Reference in New Issue
Block a user