From 83cf915758f830c0544165b12411f6f8b8d385a8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 31 Aug 2022 20:06:07 +0200 Subject: [PATCH] [ticket/17010] Add column for user push subscriptions PHPBB3-17010 --- phpBB/phpbb/db/migration/data/v400/add_webpush.php | 7 +++++++ phpBB/phpbb/notification/method/webpush.php | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/phpBB/phpbb/db/migration/data/v400/add_webpush.php b/phpBB/phpbb/db/migration/data/v400/add_webpush.php index 3230acfc8d..abc0ffc079 100644 --- a/phpBB/phpbb/db/migration/data/v400/add_webpush.php +++ b/phpBB/phpbb/db/migration/data/v400/add_webpush.php @@ -44,6 +44,13 @@ class add_webpush extends migration 'PRIMARY_KEY' => ['notification_type_id', 'item_id', 'item_parent_id', 'user_id'], ], ], + 'add_columns' => [ + $this->table_prefix . 'users' => [ + 'COLUMNS' => [ + 'user_push_subscriptions' => ['MTEXT_UNI', ''] + ], + ], + ], ]; } diff --git a/phpBB/phpbb/notification/method/webpush.php b/phpBB/phpbb/notification/method/webpush.php index eab1dac681..2532246624 100644 --- a/phpBB/phpbb/notification/method/webpush.php +++ b/phpBB/phpbb/notification/method/webpush.php @@ -168,17 +168,15 @@ class webpush extends \phpbb\notification\method\messenger_base // add actual web push data $data['data'] = [ + 'title' => $this->config['sitename'], 'body' => $notification->get_title(), 'icon' => '', // @todo: to be filled? 'image' => '', // @todo: to be filled? - 'title' => $this->config['sitename'], 'url' => $notification->get_url(), 'user_id' => $notification->user_id, ]; $json_data = json_encode($data); - // @todo: start implementing actual web push code - foreach ($user_subscriptions as $subscription) { try