/**
  * Mark auto-reviewed edits as patrolled
  */
 public static function autoMarkPatrolled(RecentChange &$rc)
 {
     if (empty($rc->mAttribs['rc_this_oldid'])) {
         return true;
     }
     $fa = FlaggableWikiPage::getTitleInstance($rc->getTitle());
     $fa->loadPageData('fromdbmaster');
     // Is the page reviewable?
     if ($fa->isReviewable()) {
         $revId = $rc->mAttribs['rc_this_oldid'];
         // If the edit we just made was reviewed, then it's the stable rev
         $frev = FlaggedRevision::newFromTitle($rc->getTitle(), $revId, FR_MASTER);
         // Reviewed => patrolled
         if ($frev) {
             RevisionReviewForm::updateRecentChanges($rc, 'patrol', $frev);
             $rc->mAttribs['rc_patrolled'] = 1;
             // make sure irc/email notifs know status
         }
         return true;
     }
     return true;
 }
 /**
  * When an edit is made to a page:
  * (a) If the page is reviewable, silently mark the edit patrolled if it was auto-reviewed
  * (b) If the page can be patrolled, auto-patrol the edit patrolled as normal
  * (c) If the page is new and $wgUseNPPatrol is on, auto-patrol the edit patrolled as normal
  * (d) If the edit is neither reviewable nor patrolleable, silently mark it patrolled
  */
 public static function autoMarkPatrolled(RecentChange &$rc)
 {
     if (empty($rc->mAttribs['rc_this_oldid'])) {
         return true;
     }
     $fa = FlaggableWikiPage::getTitleInstance($rc->getTitle());
     $fa->loadPageData('fromdbmaster');
     // Is the page reviewable?
     if ($fa->isReviewable()) {
         $revId = $rc->mAttribs['rc_this_oldid'];
         $quality = FlaggedRevision::getRevQuality($revId, FR_MASTER);
         // Reviewed => patrolled
         if ($quality !== false && $quality >= FR_CHECKED) {
             RevisionReviewForm::updateRecentChanges($rc, 'patrol', $fa->getStableRev());
             $rc->mAttribs['rc_patrolled'] = 1;
             // make sure irc/email notifs know status
         }
         return true;
     }
     return true;
 }