mirror of
https://github.com/pelican-dev/panel.git
synced 2026-07-16 04:03:50 +03:00
@@ -100,6 +100,10 @@ class DispatchWebhooks
|
|||||||
{
|
{
|
||||||
$eventName = $activityLogged->model->event;
|
$eventName = $activityLogged->model->event;
|
||||||
|
|
||||||
|
if ($eventName === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$activityLogged->isServerEvent()) {
|
if (!$activityLogged->isServerEvent()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -177,6 +181,10 @@ class DispatchWebhooks
|
|||||||
$eventName = $activityLogged->model->event;
|
$eventName = $activityLogged->model->event;
|
||||||
$activityLoggedClass = ActivityLogged::class;
|
$activityLoggedClass = ActivityLogged::class;
|
||||||
|
|
||||||
|
if ($eventName === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$matchingHooks = collect();
|
$matchingHooks = collect();
|
||||||
|
|
||||||
if ($this->eventIsWatched($eventName)) {
|
if ($this->eventIsWatched($eventName)) {
|
||||||
@@ -210,8 +218,12 @@ class DispatchWebhooks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function eventIsWatched(string $eventName): bool
|
protected function eventIsWatched(?string $eventName): bool
|
||||||
{
|
{
|
||||||
|
if ($eventName === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$watchedEvents = cache()->rememberForever('watchedWebhooks', function () {
|
$watchedEvents = cache()->rememberForever('watchedWebhooks', function () {
|
||||||
return WebhookConfiguration::where('scope', WebhookScope::Global)
|
return WebhookConfiguration::where('scope', WebhookScope::Global)
|
||||||
->pluck('events')
|
->pluck('events')
|
||||||
|
|||||||
Reference in New Issue
Block a user