r46188 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46187‎ | r46188 | r46189 >
Date:05:56, 25 January 2009
Author:aaron
Status:ok
Tags:
Comment:
Convert totalcheckededits/totalreviewededits into an alternate condition for totalContentEdits for greater flexibility when these get used.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -203,9 +203,10 @@
204204 'spacing' => 3, # spacing of edit intervals
205205 'benchmarks' => 15, # how many edit intervals are needed?
206206 'recentContentEdits' => 5, # $wgContentNamespaces edits in recent changes
207 - 'totalContentEdits' => 300, # $wgContentNamespaces edits
208 - 'totalReviewedEdits' => 0, # Edits that were specifically sighted
209 - 'totalCheckedEdits' => 0, # Edits before the stable version of pages
 207+ // Either totalContentEdits reqs OR totalCheckedEdits/totalReviewedEdits requirements needed
 208+ 'totalContentEdits' => 300, # $wgContentNamespaces edits OR...
 209+ 'totalCheckedEdits' => 0, # ...Edits before the stable version of pages AND...
 210+ 'totalReviewedEdits' => 0, # ...Edits that were specifically sighted
210211 'uniqueContentPages' => 12, # $wgContentNamespaces unique pages edited
211212 'editComments' => 50, # how many edit comments used?
212213 'email' => false, # user must be emailconfirmed?
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -863,15 +863,15 @@
864864 FlaggedRevs::saveUserParams( $user->getId(), $p );
865865 }
866866 # Check if user edited enough content pages
 867+ $totalCheckedEditsNeeded = false;
867868 if( $wgFlaggedRevsAutopromote['totalContentEdits'] > $p['totalContentEdits'] ) {
868 - wfProfileOut( __METHOD__ );
869 - return true;
 869+ # Check if the user has enough sighted edits
 870+ if( $wgFlaggedRevsAutopromote['totalReviewedEdits'] > $p['reviewedEdits'] ) {
 871+ wfProfileOut( __METHOD__ );
 872+ return true;
 873+ }
 874+ $totalCheckedEditsNeeded = true;
870875 }
871 - # Check if the user has enough sighted edits
872 - if( $wgFlaggedRevsAutopromote['totalReviewedEdits'] > $p['reviewedEdits'] ) {
873 - wfProfileOut( __METHOD__ );
874 - return true;
875 - }
876876 # Check if user edited enough unique pages
877877 if( $wgFlaggedRevsAutopromote['uniqueContentPages'] > count($pages) ) {
878878 wfProfileOut( __METHOD__ );
@@ -1043,7 +1043,7 @@
10441044 }
10451045 }
10461046 # Check implicitly sighted edits
1047 - if( $wgFlaggedRevsAutopromote['totalCheckedEdits'] ) {
 1047+ if( $totalCheckedEditsNeeded && $wgFlaggedRevsAutopromote['totalCheckedEdits'] ) {
10481048 $dbr = isset($dbr) ? $dbr : wfGetDB( DB_SLAVE );
10491049 $res = $dbr->select( array('revision','flaggedpages'), '1',
10501050 array( 'rev_user' => $user->getID(), 'fp_page_id = rev_page', 'fp_stable >= rev_id' ),

Status & tagging log