$revisionId = 0;
$dbw->rollback();
} else {
+ global $wgUseRCPatrol;
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, $baseRevId, $user) );
-
# Update recentchanges
if( !( $flags & EDIT_SUPPRESS_RC ) ) {
+ # Mark as patrolled if the user can do so
+ $patrolled = $wgUseRCPatrol && $user->isAllowed('autopatrol');
+ # Add RC row to the DB
$rc = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $user, $summary,
$this->mLatest, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
- $revisionId );
-
- # Mark as patrolled if the user can do so
- if( $GLOBALS['wgUseRCPatrol'] && $user->isAllowed( 'autopatrol' ) ) {
- RecentChange::markPatrolled( $rc, true );
+ $revisionId, $patrolled
+ );
+ # Log auto-patrolled edits
+ if( $patrolled ) {
+ PatrolLog::record( $rc, true );
}
}
$user->incEditCount();
$this->updateRevisionOn( $dbw, $revision, 0 );
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false, $user) );
-
+ # Update recentchanges
if( !( $flags & EDIT_SUPPRESS_RC ) ) {
+ global $wgUseRCPatrol, $wgUseNPPatrol;
+ # Mark as patrolled if the user can do so
+ $patrolled = ($wgUseRCPatrol || $wgUseNPPatrol) && $user->isAllowed('autopatrol');
+ # Add RC row to the DB
$rc = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $user, $summary, $bot,
- '', strlen( $text ), $revisionId );
- # Mark as patrolled if the user can
- if( ($GLOBALS['wgUseRCPatrol'] || $GLOBALS['wgUseNPPatrol']) && $user->isAllowed( 'autopatrol' ) ) {
- RecentChange::markPatrolled( $rc, true );
+ '', strlen($text), $revisionId, $patrolled );
+ # Log auto-patrolled edits
+ if( $patrolled ) {
+ PatrolLog::record( $rc, true );
}
}
$user->incEditCount();
}
# Makes an entry in the database corresponding to an edit
- public static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment,
- $oldId, $lastTimestamp, $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0)
+ public static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, $oldId,
+ $lastTimestamp, $bot, $ip='', $oldSize=0, $newSize=0, $newId=0, $patrol=0 )
{
if( !$ip ) {
$ip = wfGetIP();
'rc_moved_to_ns' => 0,
'rc_moved_to_title' => '',
'rc_ip' => $ip,
- 'rc_patrolled' => 0,
+ 'rc_patrolled' => intval($patrol),
'rc_new' => 0, # obsolete
'rc_old_len' => $oldSize,
'rc_new_len' => $newSize,
* @todo Document parameters and return
*/
public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot,
- $ip='', $size = 0, $newId = 0 )
+ $ip='', $size=0, $newId=0, $patrol=0 )
{
if( !$ip ) {
$ip = wfGetIP();
'rc_moved_to_ns' => 0,
'rc_moved_to_title' => '',
'rc_ip' => $ip,
- 'rc_patrolled' => 0,
+ 'rc_patrolled' => intval($patrol),
'rc_new' => 1, # obsolete
'rc_old_len' => 0,
'rc_new_len' => $size,