Article::onArticleCreate( $this->mTitle );
if(!$suppressRC) {
require_once( 'RecentChange.php' );
- RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, 'default',
+ $rcid = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, 'default',
'', strlen( $text ), $revisionId );
+ # Mark as patrolled if the user can and has the option set
+ if( $wgUser->isAllowed( 'patrol' ) && $wgUser->getOption( 'autopatrol' ) ) {
+ RecentChange::markPatrolled( $rcid );
+ }
}
if ($watchthis) {
# Update recentchanges and purge cache and whatnot
require_once( 'RecentChange.php' );
$bot = (int)($wgUser->isBot() || $forceBot);
- RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
+ $rcid = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
$lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
$revisionId );
+
+ # Mark as patrolled if the user can do so and has it set in their options
+ if( $wgUser->isAllowed( 'patrol' ) && $wgUser->getOption( 'autopatrol' ) ) {
+ RecentChange::markPatrolled( $rcid );
+ }
+
$dbw->commit();
// Update caches outside the main transaction
# Insert new row
$dbw->insert( 'recentchanges', $this->mAttribs, $fname );
- if ( $wgUseRCPatrol ) {
- # Retrieve the id assigned by the db, but only if we'll use it later
- $this->mAttribs['rc_id'] = $dbw->insertId();
- }
+ # Set the ID
+ $this->mAttribs['rc_id'] = $dbw->insertId();
# Update old rows, if necessary
if ( $this->mAttribs['rc_type'] == RC_EDIT ) {
'newSize' => $newSize,
);
$rc->save();
+ return( $rc->mAttribs['rc_id'] );
}
# Makes an entry in the database corresponding to page creation
'minordefault',
'externaleditor',
'externaldiff',
- $wgLivePreview ? 'uselivepreview' : false, )
+ $wgLivePreview ? 'uselivepreview' : false,
+ $wgUser->isAllowed( 'patrol' ) ? 'autopatrol' : false, )
) . '</fieldset>'
);
+ $this->mUsedToggles['autopatrol'] = true; # Don't show this up for users who can't; the handler below is dumb and doesn't know it
$wgOut->addHTML( '<fieldset><legend>' . htmlspecialchars(wfMsg('prefs-rc')) . '</legend>' .
'<label for="wpRecent">' . wfMsg ( 'recentchangescount' ) .
'tog-externaldiff' => 'Use external diff by default',
'tog-showjumplinks' => 'Enable "jump to" accessibility links',
'tog-uselivepreview' => 'Use live preview (JavaScript) (Experimental)',
+'tog-autopatrol' => 'Mark edits I make as patrolled',
'underline-always' => 'Always',
'underline-never' => 'Never',