Kaldari has submitted this change and it was merged.

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


Add new hook AbortTalkPageEmailNotification

Also update Thanks and Echo to master

Change-Id: I741b917d2c0862935f9a6cbf8b0a9b892dc78c28
---
M RELEASE-NOTES-1.22
M docs/hooks.txt
M extensions/Echo
M extensions/Thanks
M includes/UserMailer.php
5 files changed, 11 insertions(+), 3 deletions(-)

Approvals:
  Kaldari: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 17db2cc..3b96f6d 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -88,6 +88,8 @@
   current revision is patrollable. This also removed the usage of the rcid URI 
parameters.
 * Add a new parameter $patrolFooterShown to hook ArticleViewFooter so the hook
   handlers can take further action based on the status of the patrol footer
+* 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 3c77985..3fdcf56 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/extensions/Echo b/extensions/Echo
index 5ca8b8f..dc6e839 160000
--- a/extensions/Echo
+++ b/extensions/Echo
-Subproject commit 5ca8b8f1c7e9b5f1a57bb4589c9a9f72f35872ad
+Subproject commit dc6e8394fceff0ed61c89d62312c4dfa13f9f794
diff --git a/extensions/Thanks b/extensions/Thanks
index 36003bd..81364e9 160000
--- a/extensions/Thanks
+++ b/extensions/Thanks
-Subproject commit 36003bd6dbae28844f5662a91d104fc6e81c30c6
+Subproject commit 81364e9f568734890db2f8dc0512ebf3ec340191
diff --git a/includes/UserMailer.php b/includes/UserMailer.php
index e48070a..2a549ac 100644
--- a/includes/UserMailer.php
+++ b/includes/UserMailer.php
@@ -668,11 +668,13 @@
                        } elseif ( $targetUser->getOption( 
'enotifusertalkpages' ) &&
                                ( !$minorEdit || $targetUser->getOption( 
'enotifminoredits' ) ) )
                        {
-                               if ( $targetUser->isEmailConfirmed() ) {
+                               if ( !$targetUser->isEmailConfirmed() ) {
+                                       wfDebug( __METHOD__ . ": talk page 
owner doesn't have validated email\n" );
+                               } elseif ( !wfRunHooks( 
'AbortTalkPageEmailNotification', array( $targetUser, $title ) ) ) {
+                                       wfDebug( __METHOD__ . ": talk page 
update notification is aborted for this user\n" );
+                               } else {
                                        wfDebug( __METHOD__ . ": sending talk 
page update notification\n" );
                                        return true;
-                               } else {
-                                       wfDebug( __METHOD__ . ": talk page 
owner doesn't have validated email\n" );
                                }
                        } else {
                                wfDebug( __METHOD__ . ": talk page owner 
doesn't want notifications\n" );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I741b917d2c0862935f9a6cbf8b0a9b892dc78c28
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.22wmf5
Gerrit-Owner: Kaldari <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to