Merge "$wgUsersNotifiedOnAllChanges should not send mail twice"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 16 Dec 2015 19:40:01 +0000 (19:40 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 16 Dec 2015 19:40:01 +0000 (19:40 +0000)
includes/mail/EmailNotification.php

index 044bb53..f557c1a 100644 (file)
@@ -216,6 +216,7 @@ class EmailNotification {
        public function actuallyNotifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit,
                $oldid, $watchers, $pageStatus = 'changed' ) {
                # we use $wgPasswordSender as sender's address
+               global $wgUsersNotifiedOnAllChanges;
                global $wgEnotifWatchlist, $wgBlockDisablesLogin;
                global $wgEnotifMinorEdits, $wgEnotifUserTalk;
 
@@ -262,6 +263,7 @@ class EmailNotification {
                                                && ( !$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 @@ class EmailNotification {
                        }
                }
 
-               global $wgUsersNotifiedOnAllChanges;
                foreach ( $wgUsersNotifiedOnAllChanges as $name ) {
                        if ( $editor->getName() == $name ) {
                                // No point notifying the user that actually made the change!