diff --git a/app/Notifications/Telegram/TestNotification.php b/app/Notifications/Telegram/TestNotification.php index f62114941..e67ebc232 100644 --- a/app/Notifications/Telegram/TestNotification.php +++ b/app/Notifications/Telegram/TestNotification.php @@ -2,6 +2,7 @@ namespace App\Notifications\Telegram; +use App\Settings\NotificationSettings; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Notification; @@ -11,6 +12,18 @@ class TestNotification extends Notification implements ShouldQueue { use Queueable; + protected $settings; + + /** + * Create a new notification instance. + * + * @return void + */ + public function __construct($message) + { + $this->settings = new NotificationSettings(); + } + /** * Get the notification's delivery channels. * @@ -30,6 +43,7 @@ public function toTelegram(object $notifiable): TelegramMessage { return TelegramMessage::create() ->to($notifiable->routes['telegram_chat_id']) + ->disableNotification($this->settings->telegram_disable_notification) ->content('👋 Testing the Telegram notification channel.'); } } diff --git a/app/Telegram/TelegramNotification.php b/app/Telegram/TelegramNotification.php index 4b70b0b32..1346346ee 100644 --- a/app/Telegram/TelegramNotification.php +++ b/app/Telegram/TelegramNotification.php @@ -2,6 +2,7 @@ namespace App\Telegram; +use App\Settings\NotificationSettings; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use NotificationChannels\Telegram\TelegramMessage; @@ -12,6 +13,8 @@ class TelegramNotification extends Notification protected $message; + protected $settings; + /** * Create a new notification instance. * @@ -20,6 +23,8 @@ class TelegramNotification extends Notification public function __construct($message) { $this->message = $message; + + $this->settings = new NotificationSettings(); } /** @@ -41,6 +46,7 @@ public function toTelegram($notifiable): TelegramMessage { return TelegramMessage::create() ->to($notifiable->routes['telegram_chat_id']) + ->disableNotification($this->settings->telegram_disable_notification) ->content($this->message); } } diff --git a/config/speedtest.php b/config/speedtest.php index ffbaab19a..d16e91c0f 100644 --- a/config/speedtest.php +++ b/config/speedtest.php @@ -6,9 +6,9 @@ /** * Build information */ - 'build_date' => Carbon::parse('2024-02-06'), + 'build_date' => Carbon::parse('2024-02-07'), - 'build_version' => 'v0.15.0', + 'build_version' => 'v0.15.1', /** * General