Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2018-09-16 16:55:55 +02:00
commit cacbf36509
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 6 additions and 4 deletions

View file

@ -87,7 +87,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$banned_users = phpbb_get_banned_user_ids($user_ids); $banned_users = phpbb_get_banned_user_ids($user_ids);
// Load all the users we need // Load all the users we need
$this->user_loader->load_users($user_ids); $this->user_loader->load_users(array_diff($user_ids, $banned_users), array(USER_IGNORE));
// Load the messenger // Load the messenger
if (!class_exists('messenger')) if (!class_exists('messenger'))
@ -107,7 +107,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$user = $this->user_loader->get_user($notification->user_id); $user = $this->user_loader->get_user($notification->user_id);
if ($user['user_type'] == USER_IGNORE || ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL) || in_array($notification->user_id, $banned_users)) if ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL)
{ {
continue; continue;
} }

View file

@ -64,8 +64,9 @@ class user_loader
* Load user helper * Load user helper
* *
* @param array $user_ids * @param array $user_ids
* @param array $ignore_types user types to ignore
*/ */
public function load_users(array $user_ids) public function load_users(array $user_ids, array $ignore_types = array())
{ {
$user_ids[] = ANONYMOUS; $user_ids[] = ANONYMOUS;
@ -79,7 +80,8 @@ class user_loader
{ {
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . $this->users_table . ' FROM ' . $this->users_table . '
WHERE ' . $this->db->sql_in_set('user_id', $user_ids); WHERE ' . $this->db->sql_in_set('user_id', $user_ids) . '
AND ' . $this->db->sql_in_set('user_type', $ignore_types, true, true);
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))