Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -375,8 +375,10 @@ |
376 | 376 | if ( $wgEnableEmail && $newRevision && count( $affectedRevs ) > 0 ) { |
377 | 377 | // Get committer wiki user name, or repo name at least |
378 | 378 | $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 | + |
381 | 383 | // Get the authors of these revisions |
382 | 384 | $res = $dbw->select( 'code_rev', |
383 | 385 | array( |
— | — | @@ -411,18 +413,15 @@ |
412 | 414 | $revisionAuthor = $revision->getWikiUser(); |
413 | 415 | |
414 | 416 | //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 ) ) { |
416 | 418 | $users[$revisionAuthor->getId()] = $revisionAuthor; |
417 | 419 | } |
418 | 420 | |
419 | 421 | //Notify commenters and revision author of followup revision |
420 | 422 | 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 |
423 | 424 | if ( $commitAuthorId == $user->getId() ) { |
424 | | - if( !$user->getBoolOption( 'ccmeonemails' ) ) { |
425 | | - continue; |
426 | | - } |
| 425 | + continue; |
427 | 426 | } |
428 | 427 | |
429 | 428 | if ( $user->canReceiveEmail() ) { |
— | — | @@ -622,12 +621,9 @@ |
623 | 622 | } |
624 | 623 | |
625 | 624 | 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 |
628 | 626 | if ( $wgUser->getId() == $user->getId() ) { |
629 | | - if( !$user->getBoolOption( 'ccmeonemails' ) ) { |
630 | | - continue; |
631 | | - } |
| 627 | + continue; |
632 | 628 | } |
633 | 629 | |
634 | 630 | // canReceiveEmail() returns false for the fake watcher user, so exempt it |