[ticket/17489] Further queue logic adjustments

Saving queue is not needed if use_queue flag is set to false
as in this case the message should be set immediately in the runtime.

PHPBB-17487
PHPBB-17489
This commit is contained in:
rxu 2025-04-04 00:04:45 +07:00
parent cebc19f2ed
commit f9e6385e84
No known key found for this signature in database
GPG key ID: 955F0567380E586A
3 changed files with 2 additions and 24 deletions

View file

@ -269,23 +269,12 @@ class acp_email
}
$errored = !$messenger_method->send() || $errored;
$messenger_method->save_queue();
}
}
}
unset($email_list);
if ($use_queue)
{
/**
* @var \phpbb\messenger\method\messenger_interface $messenger_method
* @psalm-suppress UndefinedMethod
*/
foreach ($messenger_collection_iterator as $messenger_method)
{
$messenger_method->save_queue();
}
}
if ($generate_log_entry)
{
if (!empty($usernames))

View file

@ -223,6 +223,7 @@ class acp_inactive
]);
$messenger_method->send();
$messenger_method->save_queue();
}
}
@ -231,15 +232,6 @@ class acp_inactive
}
while ($row = $db->sql_fetchrow($result));
/**
* @var \phpbb\messenger\method\messenger_interface $messenger_method
* @psalm-suppress UndefinedMethod
*/
foreach ($messenger_collection_iterator as $messenger_method)
{
$messenger_method->save_queue();
}
// Add the remind state to the database and increase activation expiration by one day
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_reminded = user_reminded + 1,

View file

@ -157,9 +157,6 @@ class ucp_resend
]);
$messenger_method->send();
// Save the queue in the messenger method class (has to be called or these messages could be lost)
$messenger_method->save_queue();
}
}
}