diff options
| author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-09-15 11:59:30 -0500 |
|---|---|---|
| committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-09-15 11:59:30 -0500 |
| commit | a1e2fb93add6cf6ff0c83879b347d1780411a335 (patch) | |
| tree | c322a278421cd725a7b0e4300e1841a04b671cda /phpBB | |
| parent | aaf6711b44c8f86d8fc5ca0d29fb95598ddba762 (diff) | |
| download | forums-a1e2fb93add6cf6ff0c83879b347d1780411a335.tar forums-a1e2fb93add6cf6ff0c83879b347d1780411a335.tar.gz forums-a1e2fb93add6cf6ff0c83879b347d1780411a335.tar.bz2 forums-a1e2fb93add6cf6ff0c83879b347d1780411a335.tar.xz forums-a1e2fb93add6cf6ff0c83879b347d1780411a335.zip | |
[ticket/11103] Bots/Anonymous never receive notifications
Do not waste queries trying to load notifications for these users
PHPBB3-11103
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/includes/notifications/service.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/includes/notifications/service.php b/phpBB/includes/notifications/service.php index 9f3fe8326f..7fdba5e48a 100644 --- a/phpBB/includes/notifications/service.php +++ b/phpBB/includes/notifications/service.php @@ -66,6 +66,12 @@ class phpbb_notifications_service 'all_unread' => true, ), $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(); $load_special = array(); @@ -94,7 +100,7 @@ class phpbb_notifications_service $this->db->sql_freeresult($result); // Get all unread notifications - if ($options['all_unread']) + if ($options['all_unread'] && !empty($rowset)) { $sql = 'SELECT * FROM ' . NOTIFICATIONS_TABLE . ' |
