mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17010] Clean up code and remove unused method
PHPBB3-17010
This commit is contained in:
parent
a86d222ab0
commit
adf639e871
1 changed files with 5 additions and 27 deletions
|
@ -113,9 +113,9 @@ class webpush
|
|||
|
||||
$sql = 'SELECT push_data
|
||||
FROM ' . $this->notification_webpush_table . '
|
||||
WHERE user_id = ' . $this->user->id() . '
|
||||
AND notification_type_id = ' . $type_id . '
|
||||
AND item_id = ' . $item_id;
|
||||
WHERE user_id = ' . (int) $this->user->id() . '
|
||||
AND notification_type_id = ' . (int) $type_id . '
|
||||
AND item_id = ' . (int) $item_id;
|
||||
$result = $this->db->sql_query($sql);
|
||||
$notification_data = $this->db->sql_fetchfield('push_data');
|
||||
$this->db->sql_freeresult($result);
|
||||
|
@ -229,8 +229,8 @@ class webpush
|
|||
$endpoint = $data['endpoint'];
|
||||
|
||||
$sql = 'DELETE FROM ' . $this->push_subscriptions_table . '
|
||||
WHERE user_id = ' . $this->user->id() . "
|
||||
AND endpoint = '" . $this->db->sql_escape($endpoint) . "'";
|
||||
WHERE user_id = ' . (int) $this->user->id() . "
|
||||
AND endpoint = '" . (int) $this->db->sql_escape($endpoint) . "'";
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
return new JsonResponse([
|
||||
|
@ -238,26 +238,4 @@ class webpush
|
|||
'form_tokens' => $this->form_helper->get_form_tokens(self::FORM_TOKEN_UCP),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subscriptions for current user
|
||||
*
|
||||
* @return array Subscriptions for user
|
||||
*/
|
||||
protected function get_subscriptions(): array
|
||||
{
|
||||
$subscriptions = [];
|
||||
|
||||
$sql = 'SELECT endpoint, expiration_time
|
||||
FROM ' . $this->push_subscriptions_table . '
|
||||
WHERE user_id = ' . $this->user->id();
|
||||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$subscriptions[] = $row;
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
return $subscriptions;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue