Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't require email templates presence for webpush notifications. #92

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions notification/method/webpush.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use phpbb\controller\helper;
use phpbb\db\driver\driver_interface;
use phpbb\log\log_interface;
use phpbb\notification\method\messenger_base;
use phpbb\notification\type\type_interface;
use phpbb\path_helper;
use phpbb\user;
Expand All @@ -27,7 +26,7 @@
* Web Push notification method class
* This class handles sending push messages for notifications
*/
class webpush extends messenger_base implements extended_method_interface
class webpush extends \phpbb\notification\method\base implements extended_method_interface
rxu marked this conversation as resolved.
Show resolved Hide resolved
{
/** @var config */
protected $config;
Expand Down Expand Up @@ -78,8 +77,11 @@ public function __construct(config $config, driver_interface $db, log_interface
$this->config = $config;
$this->db = $db;
$this->log = $log;
$this->user_loader = $user_loader;
$this->user = $user;
$this->path_helper = $path_helper;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->notification_webpush_table = $notification_webpush_table;
$this->push_subscriptions_table = $push_subscriptions_table;
}
Expand All @@ -97,8 +99,9 @@ public function get_type(): string
*/
public function is_available(type_interface $notification_type = null): bool
{
return parent::is_available($notification_type) && $this->config['wpn_webpush_enable']
&& !empty($this->config['wpn_webpush_vapid_public']) && !empty($this->config['wpn_webpush_vapid_private']);
return $this->config['wpn_webpush_enable']
rxu marked this conversation as resolved.
Show resolved Hide resolved
&& $this->config['wpn_webpush_vapid_public']
&& $this->config['wpn_webpush_vapid_private'];
}

/**
Expand Down
Loading