mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17010] Add prune notification support to webpush
PHPBB3-17010
This commit is contained in:
parent
ad196d1dba
commit
a8dc08a219
1 changed files with 13 additions and 0 deletions
|
@ -292,6 +292,19 @@ class webpush extends messenger_base
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public function prune_notifications($timestamp, $only_read = true): void
|
||||||
|
{
|
||||||
|
$sql = 'DELETE FROM ' . $this->notification_webpush_table . '
|
||||||
|
WHERE notification_time < ' . (int) $timestamp .
|
||||||
|
(($only_read) ? ' AND notification_read = 1' : '');
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
|
$this->config->set('read_notification_last_gc', (string) time(), false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean data to contain only what we need for webpush notifications table
|
* Clean data to contain only what we need for webpush notifications table
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue