aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-01-13 23:31:37 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-01-13 23:31:37 +0100
commit853733a0eb04f917fe3195ed9f36cfcf643deffd (patch)
treee7d50b5bbd3c907fe990db8e8a39634561e4673a /phpBB/phpbb
parent26beafa5645f18fe1a391092d1cfbb122342e060 (diff)
parente3e16a0166eafc9f273d3eabc61a8bd711610787 (diff)
downloadforums-853733a0eb04f917fe3195ed9f36cfcf643deffd.tar
forums-853733a0eb04f917fe3195ed9f36cfcf643deffd.tar.gz
forums-853733a0eb04f917fe3195ed9f36cfcf643deffd.tar.bz2
forums-853733a0eb04f917fe3195ed9f36cfcf643deffd.tar.xz
forums-853733a0eb04f917fe3195ed9f36cfcf643deffd.zip
Merge branch 'develop-ascraeus' into develop
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/notification/manager.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index dd611e1dd1..aa52eb61d0 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -38,6 +38,9 @@ class manager
/** @var \phpbb\config\config */
protected $config;
+ /** @var \phpbb\event\dispatcher */
+ protected $phpbb_dispatcher;
+
/** @var \phpbb\db\driver\driver_interface */
protected $db;
@@ -70,6 +73,7 @@ class manager
* @param ContainerInterface $phpbb_container
* @param \phpbb\user_loader $user_loader
* @param \phpbb\config\config $config
+ * @param \phpbb\event\dispatcher $phpbb_dispatcher
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\service $cache
* @param \phpbb\user $user
@@ -81,7 +85,7 @@ class manager
*
* @return \phpbb\notification\manager
*/
- public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
{
$this->notification_types = $notification_types;
$this->notification_methods = $notification_methods;
@@ -89,6 +93,7 @@ class manager
$this->user_loader = $user_loader;
$this->config = $config;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
@@ -350,6 +355,26 @@ class manager
// find out which users want to receive this type of notification
$notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options);
+ /**
+ * Allow filtering the notify_users array for a notification that is about to be sent.
+ * Here, $notify_users is already filtered by f_read and the ignored list included in the options variable
+ *
+ * @event core.notification_manager_add_notifications
+ * @var string notification_type_name The forum id from where the topic belongs
+ * @var array data Data specific for the notification_type_name used will be inserted
+ * @var array notify_users The array of userid that are going to be notified for this notification. Set to array() to cancel.
+ * @var array options The options that were used when this method was called (read only)
+ *
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'notification_type_name',
+ 'data',
+ 'notify_users',
+ 'options',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars)));
+
$this->add_notifications_for_users($notification_type_name, $data, $notify_users);
return $notify_users;