* @param string $params
* @param int $newId
* @param string $actionCommentIRC
+ * @param int $revId Id of associated revision, if any
* @return RecentChange
*/
public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip,
- $type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = '' ) {
+ $type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = '',
+ $revId = 0 ) {
global $wgRequest;
# # Get pageStatus for email notification
break;
}
+ // Allow unpatrolled status when an associated rev id is passed
+ // May be used in core by moves and uploads
+ $markPatrolled = ( $revId > 0 ) ? $user->isAllowed( 'autopatrol' ) : true;
+
$rc = new RecentChange;
$rc->mTitle = $target;
$rc->mPerformer = $user;
'rc_user' => $user->getId(),
'rc_user_text' => $user->getName(),
'rc_comment' => $logComment,
- 'rc_this_oldid' => 0,
+ 'rc_this_oldid' => $revId,
'rc_last_oldid' => 0,
'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot', true ) : 0,
'rc_ip' => self::checkIPAddress( $ip ),
- 'rc_patrolled' => 1,
+ 'rc_patrolled' => $markPatrolled ? 1 : 0,
'rc_new' => 0, # obsolete
'rc_old_len' => null,
'rc_new_len' => null,