r83184 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83183‎ | r83184 | r83185 >
Date:23:59, 3 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Revert r74967 also
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -375,8 +375,10 @@
376376 if ( $wgEnableEmail && $newRevision && count( $affectedRevs ) > 0 ) {
377377 // Get committer wiki user name, or repo name at least
378378 $commitAuthor = $this->getWikiUser();
379 - # Author might not have a username in the wiki:
380 - $committer = $commitAuthor ? $commitAuthor->getName() : htmlspecialchars( $this->author );
 379+
 380+ $commitAuthorId = $commitAuthor->getId();
 381+ $committer = $commitAuthor ? $commitAuthor->getName() : htmlspecialchars( $this->mAuthor );
 382+
381383 // Get the authors of these revisions
382384 $res = $dbw->select( 'code_rev',
383385 array(
@@ -411,18 +413,15 @@
412414 $revisionAuthor = $revision->getWikiUser();
413415
414416 //Add the followup revision author if they have not already been added as a commentor (they won't want dupe emails!)
415 - if ( $revisionAuthor && !array_key_exists( $revisionAuthor->getId(), $users ) ) {
 417+ if ( !array_key_exists( $revisionAuthor->getId(), $users ) ) {
416418 $users[$revisionAuthor->getId()] = $revisionAuthor;
417419 }
418420
419421 //Notify commenters and revision author of followup revision
420422 foreach ( $users as $user ) {
421 - // Notify user with its own message if he already want
422 - // to be CCed of all emails it sends.
 423+ // No sense in notifying the author of this rev if they are a commenter/the author on the target rev
423424 if ( $commitAuthorId == $user->getId() ) {
424 - if( !$user->getBoolOption( 'ccmeonemails' ) ) {
425 - continue;
426 - }
 425+ continue;
427426 }
428427
429428 if ( $user->canReceiveEmail() ) {
@@ -622,12 +621,9 @@
623622 }
624623
625624 foreach ( $users as $id => $user ) {
626 - // Notify user with its own message if he already want
627 - // to be CCed of all emails it sends.
 625+ // No sense in notifying this commenter
628626 if ( $wgUser->getId() == $user->getId() ) {
629 - if( !$user->getBoolOption( 'ccmeonemails' ) ) {
630 - continue;
631 - }
 627+ continue;
632628 }
633629
634630 // canReceiveEmail() returns false for the fake watcher user, so exempt it

Follow-up revisions

RevisionCommit summaryAuthorDate
r83185MFT r83182, r83184reedy00:03, 4 March 2011
r83186MFT r83182, r83184reedy00:06, 4 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74967* Let user receives its own comments by emails if already wants...hashar20:50, 18 October 2010

Status & tagging log