From ee9fcbb671a9c429228473d760af14ab54a65567 Mon Sep 17 00:00:00 2001 From: bsitu Date: Thu, 20 Feb 2014 17:40:29 -0800 Subject: [PATCH] Add new Hook 'SendWatchlistEmailNotification' Bug: 53569 Change-Id: I73d5eef9a18d59b022c353c4b7d2aee18bfa6591 --- RELEASE-NOTES-1.23 | 2 ++ docs/hooks.txt | 5 +++++ includes/UserMailer.php | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index be53faf74f..9b8050c0f1 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -107,6 +107,8 @@ production. parameter, which overrides the 'options' parameter. * Admins can expire users users passwords manually, or on a schedule using the $wgPasswordExpirationDays configuration setting. +* Add new hook SendWatchlistEmailNotification, this will be used to determine + whether to send a watchlist email notification. === Bug fixes in 1.23 === * (bug 41759) The "updated since last visit" markers (on history pages, recent diff --git a/docs/hooks.txt b/docs/hooks.txt index b9423a83fd..e7fa89bae4 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -277,6 +277,11 @@ $user: the User object about to be created (read-only, incomplete) $targetUser: the user whom to send talk page email notification $title: the page title +'SendWatchlistEmailNotification': Return true to send watchlist email notification +$targetUser: the user whom to send watchlist email notification +$title: the page title +$this: EmailNotification object + 'AbortChangePassword': Return false to cancel password change. $user: the User object to which the password change is occuring $mOldpass: the old password provided by the user diff --git a/includes/UserMailer.php b/includes/UserMailer.php index e1d00d33f8..fe80929a56 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -649,7 +649,9 @@ class EmailNotification { && $watchingUser->isEmailConfirmed() && $watchingUser->getID() != $userTalkId ) { - $this->compose( $watchingUser ); + if ( wfRunHooks( 'SendWatchlistEmailNotification', array( $watchingUser, $title, $this ) ) ) { + $this->compose( $watchingUser ); + } } } } -- 2.20.1