Add new Hook 'SendWatchlistEmailNotification'
authorbsitu <bsitu@wikimedia.org>
Fri, 21 Feb 2014 01:40:29 +0000 (17:40 -0800)
committerbsitu <bsitu@wikimedia.org>
Wed, 26 Feb 2014 01:04:00 +0000 (17:04 -0800)
Bug: 53569
Change-Id: I73d5eef9a18d59b022c353c4b7d2aee18bfa6591

RELEASE-NOTES-1.23
docs/hooks.txt
includes/UserMailer.php

index be53faf..9b8050c 100644 (file)
@@ -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
index b9423a8..e7fa89b 100644 (file)
@@ -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
index e1d00d3..fe80929 100644 (file)
@@ -649,7 +649,9 @@ class EmailNotification {
                                                && $watchingUser->isEmailConfirmed()
                                                && $watchingUser->getID() != $userTalkId
                                        ) {
-                                               $this->compose( $watchingUser );
+                                               if ( wfRunHooks( 'SendWatchlistEmailNotification', array( $watchingUser, $title, $this ) ) ) {
+                                                       $this->compose( $watchingUser );
+                                               }
                                        }
                                }
                        }