Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | $wgExtensionCredits['specialpage'][] = array( |
26 | 26 | 'name' => 'Flagged Revisions', |
27 | 27 | 'author' => array( 'Aaron Schulz', 'Joerg Baach' ), |
28 | | - 'version' => '1.08', |
| 28 | + 'version' => '1.09', |
29 | 29 | 'url' => 'http://www.mediawiki.org/wiki/Extension:FlaggedRevs', |
30 | 30 | 'descriptionmsg' => 'flaggedrevs-desc', |
31 | 31 | ); |
— | — | @@ -111,10 +111,6 @@ |
112 | 112 | 'style' => array( 'review' => 3 ), |
113 | 113 | ); |
114 | 114 | |
115 | | -# Mark all previous edits as "patrolled" when an edit is reviewed. |
116 | | -# This just sets markers on recent changes. |
117 | | -$wgFlaggedRevsCascade = true; |
118 | | - |
119 | 115 | # Please set these as something different. Any text will do, though it probably |
120 | 116 | # shouldn't be very short (less secure) or very long (waste of resources). |
121 | 117 | # There must be four codes, and only the first four are checked. |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -979,13 +979,7 @@ |
980 | 980 | } |
981 | 981 | # Mark as patrolled |
982 | 982 | if( $patrol ) { |
983 | | - $dbw->update( 'recentchanges', |
984 | | - array( 'rc_patrolled' => 1 ), |
985 | | - array( 'rc_this_oldid' => $rev->getId(), |
986 | | - 'rc_user_text' => $rev->getRawUserText(), |
987 | | - 'rc_timestamp' => $dbw->timestamp( $rev->getTimestamp() ) ), |
988 | | - __METHOD__, |
989 | | - array( 'LIMIT' => 1 ) ); |
| 983 | + RevisionReview::updateRecentChanges( $title, $rev->getId() ); |
990 | 984 | } |
991 | 985 | # Done! |
992 | 986 | $dbw->commit(); |
— | — | @@ -1654,7 +1648,7 @@ |
1655 | 1649 | $patrol = true; // mark by default |
1656 | 1650 | } |
1657 | 1651 | if( $patrol ) { |
1658 | | - RecentChange::markPatrolled( $rc->mAttribs['rc_id'] ); |
| 1652 | + RevisionReview::updateRecentChanges( $rc->getTitle(), $rc->mAttribs['rc_this_oldid'] ); |
1659 | 1653 | if( $record ) { |
1660 | 1654 | PatrolLog::record( $rc->mAttribs['rc_id'], true ); |
1661 | 1655 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php |
— | — | @@ -618,7 +618,7 @@ |
619 | 619 | } |
620 | 620 | |
621 | 621 | # Update recent changes |
622 | | - $this->updateRecentChanges( $this->page, $dbw, $rev, $this->rcid ); |
| 622 | + self::updateRecentChanges( $this->page, $rev->getId(), $this->rcid ); |
623 | 623 | |
624 | 624 | # Update the article review log |
625 | 625 | $this->updateLog( $this->page, $this->dims, $this->oflags, $this->comment, $this->oldid, $oldSvId, true ); |
— | — | @@ -719,36 +719,27 @@ |
720 | 720 | return true; |
721 | 721 | } |
722 | 722 | |
723 | | - private function updateRecentChanges( $title, $dbw, $rev, $rcid ) { |
| 723 | + public static function updateRecentChanges( $title, $revId, $rcId = false ) { |
724 | 724 | wfProfileIn( __METHOD__ ); |
725 | | - # Should olders edits be marked as patrolled now? |
726 | | - global $wgFlaggedRevsCascade; |
727 | | - if( $wgFlaggedRevsCascade ) { |
| 725 | + $dbw = wfGetDB( DB_MASTER ); |
| 726 | + # Olders edits be marked as patrolled now... |
| 727 | + $dbw->update( 'recentchanges', |
| 728 | + array( 'rc_patrolled' => 1 ), |
| 729 | + array( 'rc_namespace' => $title->getNamespace(), |
| 730 | + 'rc_title' => $title->getDBKey(), |
| 731 | + 'rc_this_oldid <= ' . intval($revId) ), |
| 732 | + __METHOD__, |
| 733 | + array( 'USE INDEX' => 'rc_namespace_title', 'LIMIT' => 50 ) |
| 734 | + ); |
| 735 | + # New page patrol may be enabled. If so, the rc_id may be the first |
| 736 | + # edit and not this one. If it is different, mark it too. |
| 737 | + if( $rcId && $rcId != $revId ) { |
728 | 738 | $dbw->update( 'recentchanges', |
729 | 739 | array( 'rc_patrolled' => 1 ), |
730 | | - array( 'rc_namespace' => $title->getNamespace(), |
731 | | - 'rc_title' => $title->getDBKey(), |
732 | | - 'rc_this_oldid <= ' . $rev->getId() ), |
733 | | - __METHOD__, |
734 | | - array( 'USE INDEX' => 'rc_namespace_title', 'LIMIT' => 50 ) ); |
735 | | - } else { |
736 | | - # Mark this edit as patrolled... |
737 | | - $dbw->update( 'recentchanges', |
738 | | - array( 'rc_patrolled' => 1 ), |
739 | | - array( 'rc_this_oldid' => $rev->getId(), |
740 | | - 'rc_user_text' => $rev->getRawUserText(), |
741 | | - 'rc_timestamp' => $dbw->timestamp( $rev->getTimestamp() ) ), |
742 | | - __METHOD__, |
743 | | - array( 'USE INDEX' => 'rc_user_text', 'LIMIT' => 1 ) ); |
744 | | - # New page patrol may be enabled. If so, the rc_id may be the first |
745 | | - # edit and not this one. If it is different, mark it too. |
746 | | - if( $rcid && $rcid != $rev->getId() ) { |
747 | | - $dbw->update( 'recentchanges', |
748 | | - array( 'rc_patrolled' => 1 ), |
749 | | - array( 'rc_id' => $rcid, |
750 | | - 'rc_type' => RC_NEW ), |
751 | | - __METHOD__ ); |
752 | | - } |
| 740 | + array( 'rc_id' => $rcid, |
| 741 | + 'rc_type' => RC_NEW ), |
| 742 | + __METHOD__ |
| 743 | + ); |
753 | 744 | } |
754 | 745 | wfProfileOut( __METHOD__ ); |
755 | 746 | } |