mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00: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:
parent
aaf6711b44
commit
a1e2fb93ad
1 changed files with 7 additions and 1 deletions
|
@ -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 . '
|
||||||
|
|
Loading…
Add table
Reference in a new issue