Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67901


Change subject: Add new hook AbortTalkPageEmailNotification
......................................................................

Add new hook AbortTalkPageEmailNotification

This hook will allow extension to disable the regular talk page email 
notification,
Echo is doing this with a hackish solution of setting global variable
wgEnotifUserTalk to false on the fly, this approach is problematic and will
be replaced with this hook

Change-Id: Ie043d9a1a771d64e4b05b7ddeca75c7542a6c575
---
M RELEASE-NOTES-1.22
M docs/hooks.txt
M includes/UserMailer.php
3 files changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/67901/1

diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 6534215..0b1d88a 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -109,6 +109,8 @@
   for extensions such as OAuth:
 ** editmyusercss controls whether a user may edit their own CSS subpages.
 ** editmyuserjs controls whether a user may edit their own JS subpages.
+* Add new hook AbortTalkPageEmailNotification, this will be used to determine
+  whether to send the regular talk page email notification
 
 === Bug fixes in 1.22 ===
 * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 66b5068..2bbb79a 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -270,6 +270,10 @@
 $user: the User object about to be created (read-only, incomplete)
 &$msg: out parameter: HTML to display on abort
 
+'AbortTalkPageEmailNotification': Return false to cancel talk page email 
notification
+$$targetUser: the user whom to send talk page email notification
+$title: the page title
+
 '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 e48070a..f2d628b 100644
--- a/includes/UserMailer.php
+++ b/includes/UserMailer.php
@@ -669,8 +669,11 @@
                                ( !$minorEdit || $targetUser->getOption( 
'enotifminoredits' ) ) )
                        {
                                if ( $targetUser->isEmailConfirmed() ) {
-                                       wfDebug( __METHOD__ . ": sending talk 
page update notification\n" );
-                                       return true;
+                                       if ( wfRunHooks( 
'AbortTalkPageEmailNotification', array( $targetUser, $title ) ) ) {
+                                               wfDebug( __METHOD__ . ": 
sending talk page update notification\n" );
+                                               return true;
+                                       }
+                                       wfDebug( __METHOD__ . ": talk page 
update notification is aborted for this user\n" );
                                } else {
                                        wfDebug( __METHOD__ . ": talk page 
owner doesn't have validated email\n" );
                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/67901
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie043d9a1a771d64e4b05b7ddeca75c7542a6c575
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to