diff --git a/notification/method/webpush.php b/notification/method/webpush.php index 375ddc4..295b12b 100644 --- a/notification/method/webpush.php +++ b/notification/method/webpush.php @@ -445,7 +445,7 @@ protected function clean_expired_subscriptions(array $user_subscription_map, arr * into https://myboard.url/path/to/avatar=123456789.gif * * @param string $avatar - * @return array Absolute path to avatar image in an array with src as its key + * @return string Absolute path to avatar image */ protected function prepare_avatar($avatar) { @@ -455,7 +455,7 @@ protected function prepare_avatar($avatar) $path = !empty($matches[1]) ? end($matches[1]) : $avatar; - return ['src' => preg_replace('#^' . preg_quote($this->path_helper->get_web_root_path(), '#') . '#', $this->get_board_url(), $path, 1)]; + return preg_replace('#^' . preg_quote($this->path_helper->get_web_root_path(), '#') . '#', $this->get_board_url(), $path, 1); } /** diff --git a/styles/all/template/push_worker.js.twig b/styles/all/template/push_worker.js.twig index 8d6ec3c..428c211 100644 --- a/styles/all/template/push_worker.js.twig +++ b/styles/all/template/push_worker.js.twig @@ -36,7 +36,7 @@ self.addEventListener('push', event => { const options = { body: responseBody, data: response, - icon: response.avatar.src, + icon: response.avatar, }; self.registration.showNotification(response.heading, options); });