X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fchanges%2FRecentChange.php;h=9025736c69684bf9ad3034ce1ef96c6174321c0a;hb=682e2b9c6b7c439fe5ba0be083f0479af95e1db3;hp=07d148762676bd32b75126e4afc216b1b94ad0a2;hpb=557c331645173b60171e1cbcc9b921e39de9710b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 07d1487626..9025736c69 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -324,15 +324,21 @@ class RecentChange { $editor = $this->getPerformer(); $title = $this->getTitle(); - if ( Hooks::run( 'AbortEmailNotification', array( $editor, $title, $this ) ) ) { - # @todo FIXME: This would be better as an extension hook - $enotif = new EmailNotification(); - $enotif->notifyOnPageChange( $editor, $title, - $this->mAttribs['rc_timestamp'], - $this->mAttribs['rc_comment'], - $this->mAttribs['rc_minor'], - $this->mAttribs['rc_last_oldid'], - $this->mExtra['pageStatus'] ); + // Never send an RC notification email about categorization changes + if ( $this->mAttribs['rc_type'] != RC_CATEGORIZE ) { + if ( Hooks::run( 'AbortEmailNotification', array( $editor, $title, $this ) ) ) { + # @todo FIXME: This would be better as an extension hook + $enotif = new EmailNotification(); + $enotif->notifyOnPageChange( + $editor, + $title, + $this->mAttribs['rc_timestamp'], + $this->mAttribs['rc_comment'], + $this->mAttribs['rc_minor'], + $this->mAttribs['rc_last_oldid'], + $this->mExtra['pageStatus'] + ); + } } } @@ -460,7 +466,9 @@ class RecentChange { // Automatic patrol needs "autopatrol", ordinary patrol needs "patrol" $right = $auto ? 'autopatrol' : 'patrol'; $errors = array_merge( $errors, $this->getTitle()->getUserPermissionsErrors( $right, $user ) ); - if ( !Hooks::run( 'MarkPatrolled', array( $this->getAttribute( 'rc_id' ), &$user, false ) ) ) { + if ( !Hooks::run( 'MarkPatrolled', + array( $this->getAttribute( 'rc_id' ), &$user, false, $auto ) ) + ) { $errors[] = array( 'hookaborted' ); } // Users without the 'autopatrol' right can't patrol their @@ -481,7 +489,10 @@ class RecentChange { $this->reallyMarkPatrolled(); // Log this patrol event PatrolLog::record( $this, $auto, $user ); - Hooks::run( 'MarkPatrolledComplete', array( $this->getAttribute( 'rc_id' ), &$user, false ) ); + Hooks::run( + 'MarkPatrolledComplete', + array( $this->getAttribute( 'rc_id' ), &$user, false, $auto ) + ); return array(); } @@ -950,3 +961,4 @@ class RecentChange { return $unserializedParams; } } +