mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 03:22:37 +02:00
[ticket/11103] Bots/Anonymous never receive notifications
Do not waste queries trying to load notifications for these users PHPBB3-11103
This commit is contained in:
@@ -66,6 +66,12 @@ class phpbb_notifications_service
|
|||||||
'all_unread' => true,
|
'all_unread' => true,
|
||||||
), $options);
|
), $options);
|
||||||
|
|
||||||
|
// Anonymous users and bots never receive notifications
|
||||||
|
if ($options['user_id'] == $user->data['user_id'] && ($user->data['user_id'] == ANONYMOUS || $user->data['user_type'] == USER_IGNORE))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$notifications = $user_ids = array();
|
$notifications = $user_ids = array();
|
||||||
$load_special = array();
|
$load_special = array();
|
||||||
|
|
||||||
@@ -94,7 +100,7 @@ class phpbb_notifications_service
|
|||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
// Get all unread notifications
|
// Get all unread notifications
|
||||||
if ($options['all_unread'])
|
if ($options['all_unread'] && !empty($rowset))
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . NOTIFICATIONS_TABLE . '
|
FROM ' . NOTIFICATIONS_TABLE . '
|
||||||
|
Reference in New Issue
Block a user