Skip to content

Commit 017d517

Browse files
committed
Use an array for the avatar string
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 868fc58 commit 017d517

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

notification/method/webpush.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ protected function clean_expired_subscriptions(array $user_subscription_map, arr
445445
* into https://myboard.url/path/to/avatar=123456789.gif
446446
*
447447
* @param string $avatar
448-
* @return string Absolute path to avatar image
448+
* @return array Absolute path to avatar image in an array with src as its key
449449
*/
450450
protected function prepare_avatar($avatar)
451451
{
@@ -455,7 +455,7 @@ protected function prepare_avatar($avatar)
455455

456456
$path = !empty($matches[1]) ? end($matches[1]) : $avatar;
457457

458-
return preg_replace('#^' . preg_quote($this->path_helper->get_web_root_path(), '#') . '#', $this->get_board_url(), $path, 1);
458+
return ['src' => preg_replace('#^' . preg_quote($this->path_helper->get_web_root_path(), '#') . '#', $this->get_board_url(), $path, 1)];
459459
}
460460

461461
/**

styles/all/template/push_worker.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ self.addEventListener('push', event => {
3636
const options = {
3737
body: responseBody,
3838
data: response,
39-
icon: response.avatar,
39+
icon: response.avatar.src,
4040
};
4141
self.registration.showNotification(response.heading, options);
4242
});

0 commit comments

Comments
 (0)