From f9e6385e84e6f8102b347eade20fd9595c545366 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 4 Apr 2025 00:04:45 +0700 Subject: [PATCH] [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 --- phpBB/includes/acp/acp_email.php | 13 +------------ phpBB/includes/acp/acp_inactive.php | 10 +--------- phpBB/includes/ucp/ucp_resend.php | 3 --- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 591700f66d..dfe58eb318 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -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)) diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 935df27c14..e1a511852b 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -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, diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index 4ae14e0ba8..43e26567e5 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -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(); } } }