diff options
Diffstat (limited to 'phpBB/phpbb/notification/manager.php')
-rw-r--r-- | phpBB/phpbb/notification/manager.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 97833710c0..dab69bcff9 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -59,7 +59,7 @@ class phpbb_notification_manager /** * Notification Constructor - * + * * @param array $notification_types * @param array $notification_methods * @param ContainerBuilder $phpbb_container @@ -796,11 +796,13 @@ class phpbb_notification_manager * Delete all notifications older than a certain time * * @param int $timestamp Unix timestamp to delete all notifications that were created before + * @param bool $only_unread True (default) to only prune read notifications */ - public function prune_notifications($timestamp) + public function prune_notifications($timestamp, $only_read = true) { $sql = 'DELETE FROM ' . $this->notifications_table . ' - WHERE notification_time < ' . (int) $timestamp; + WHERE notification_time < ' . (int) $timestamp . + (($only_read) ? ' AND notification_read = 1' : ''); $this->db->sql_query($sql); } @@ -834,12 +836,12 @@ class phpbb_notification_manager protected function load_object($object_name) { $object = $this->phpbb_container->get($object_name); - + if (method_exists($object, 'set_notification_manager')) { $object->set_notification_manager($this); } - + return $object; } |