jenkins-bot has submitted this change and it was merged.

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


$wgUsersNotifiedOnAllChanges should not send mail twice

Also make sure that normal watchlist functionality
works for the $wgUsersNotifiedOnAllChanges, for
example changes should marked 'bold' since last visit.

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

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



diff --git a/includes/mail/EmailNotification.php 
b/includes/mail/EmailNotification.php
index 044bb53..f557c1a 100644
--- a/includes/mail/EmailNotification.php
+++ b/includes/mail/EmailNotification.php
@@ -216,6 +216,7 @@
        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 @@
                                                && ( !$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/143373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d53f07ed3dceb5b1c541091fd69beca3fb3e94f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Rohan013 <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Glaisher <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
Gerrit-Reviewer: saper <[email protected]>

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

Reply via email to