saper has uploaded a new change for review.

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

Change subject: $wgUsersNotifiedOnAllChanges should not send mail twice
......................................................................

$wgUsersNotifiedOnAllChanges should not send mail twice

Bug: T69041

Change-Id: I9b4902a4b9965933203de01ec93d67bfcece7759
---
M includes/mail/EmailNotification.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/250435/1

diff --git a/includes/mail/EmailNotification.php 
b/includes/mail/EmailNotification.php
index 044bb53..5665f4d 100644
--- a/includes/mail/EmailNotification.php
+++ b/includes/mail/EmailNotification.php
@@ -218,6 +218,7 @@
                # we use $wgPasswordSender as sender's address
                global $wgEnotifWatchlist, $wgBlockDisablesLogin;
                global $wgEnotifMinorEdits, $wgEnotifUserTalk;
+               global $wgUsersNotifiedOnAllChanges;
 
                # The following code is only run, if several conditions are met:
                # 1. EmailNotification for pages (other than user_talk pages) 
must be enabled
@@ -262,6 +263,7 @@
                                                && ( !$minorEdit || 
$watchingUser->getOption( 'enotifminoredits' ) )
                                                && 
$watchingUser->isEmailConfirmed()
                                                && $watchingUser->getID() != 
$userTalkId
+                                               && !in_array( 
$watchingUser->getName(), $wgUsersNotifiedOnAllChanges )
                                                && !( $wgBlockDisablesLogin && 
$watchingUser->isBlocked() )
                                        ) {
                                                if ( Hooks::run( 
'SendWatchlistEmailNotification', array( $watchingUser, $title, $this ) ) ) {
@@ -272,7 +274,6 @@
                        }
                }
 
-               global $wgUsersNotifiedOnAllChanges;
                foreach ( $wgUsersNotifiedOnAllChanges as $name ) {
                        if ( $editor->getName() == $name ) {
                                // No point notifying the user that actually 
made the change!

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

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

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

Reply via email to