1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 02:36:38 +02:00

[ticket/17135] Move notify method constants to interface class

PHPBB-17135
This commit is contained in:
rxu
2025-01-06 20:01:52 +07:00
parent 28d5534d06
commit 0d8c0c4228
21 changed files with 77 additions and 50 deletions

View File

@@ -19,6 +19,7 @@ use phpbb\user_loader;
use phpbb\config\config;
use phpbb\db\driver\driver_interface;
use phpbb\di\service_collection;
use phpbb\messenger\method\messenger_interface;
/**
* Email notification method class
@@ -135,7 +136,7 @@ class email extends \phpbb\notification\method\messenger_base
$insert_buffer->flush();
$this->notify_using_messenger(NOTIFY_EMAIL);
$this->notify_using_messenger(messenger_interface::NOTIFY_EMAIL);
}
/**

View File

@@ -18,6 +18,7 @@ use phpbb\user;
use phpbb\user_loader;
use phpbb\config\config;
use phpbb\di\service_collection;
use phpbb\messenger\method\messenger_interface;
/**
* Jabber notification method class
@@ -98,6 +99,6 @@ class jabber extends \phpbb\notification\method\messenger_base
return;
}
$this->notify_using_messenger(NOTIFY_IM, 'short/');
$this->notify_using_messenger(messenger_interface::NOTIFY_IM, 'short/');
}
}

View File

@@ -67,7 +67,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
/**
* Notify using phpBB messenger
*
* @param int $notify_method Notify method for messenger (e.g. NOTIFY_IM)
* @param int $notify_method Notify method for messenger (e.g. \phpbb\messenger\method\messenger_interface::NOTIFY_IM)
* @param string $template_dir_prefix Base directory to prepend to the email template name
*
* @return void
@@ -115,7 +115,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$messenger_collection_iterator = $this->messenger->getIterator();
foreach ($messenger_collection_iterator as $messenger_method)
{
if ($messenger_method->get_id() == $notify_method || $notify_method == NOTIFY_BOTH)
if ($messenger_method->get_id() == $notify_method || $notify_method == $messenger_method::NOTIFY_BOTH)
{
$messenger_method->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix);
$messenger_method->set_addresses($user);