Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -301,12 +301,13 @@ |
302 | 302 | $dbw->insert( 'code_relations', $data, __METHOD__, array( 'IGNORE' ) ); |
303 | 303 | } |
304 | 304 | |
305 | | - global $wgEnableEmail, $wgUser; |
| 305 | + global $wgEnableEmail; |
306 | 306 | // Email the authors of revisions that this follows up on |
307 | 307 | if ( $wgEnableEmail && $newRevision && count( $affectedRevs ) > 0 ) { |
308 | 308 | // Get committer wiki user name, or repo name at least |
309 | | - $user = $this->getWikiUser(); |
310 | | - $committer = $user ? $user->getName() : htmlspecialchars( $this->mAuthor ); |
| 309 | + $commitAuthor = $this->getWikiUser(); |
| 310 | + $commitAuthorId = $commitAuthor->getId() |
| 311 | + $committer = $commitAuthor ? $commitAuthor->getName() : htmlspecialchars( $this->mAuthor ); |
311 | 312 | // Get the authors of these revisions |
312 | 313 | $res = $dbw->select( 'code_rev', |
313 | 314 | array( |
— | — | @@ -337,15 +338,17 @@ |
338 | 339 | $revision = CodeRevision::newFromRow( $row ); |
339 | 340 | $users = $revision->getCommentingUsers(); |
340 | 341 | |
341 | | - //Add the revision author if they have not already been added as a commentor (they won't want dupe emails!) |
342 | | - if ( !array_key_exists( $user->getId(), $users ) { |
343 | | - $users[$user->getId()] = $user; |
| 342 | + $revisionAuthor = $revision->getWikiUser(); |
| 343 | + |
| 344 | + //Add the followup revision author if they have not already been added as a commentor (they won't want dupe emails!) |
| 345 | + if ( !array_key_exists( $revisionAuthor->getId(), $users ) { |
| 346 | + $users[$revisionAuthor->getId()] = $revisionAuthor; |
344 | 347 | } |
345 | 348 | |
346 | 349 | //Notify commenters and revision author of followup revision |
347 | 350 | foreach ( $users as $userId => $user ) { |
348 | | - // No sense in notifying the author if they are a commenter on the target rev |
349 | | - if ( $wgUser->getId() == $user->getId() ) { |
| 351 | + // No sense in notifying the author of this rev if they are a commenter/the author on the target rev |
| 352 | + if ( $commitAuthorId == $user->getId() ) { |
350 | 353 | continue; |
351 | 354 | } |
352 | 355 | |