* @param int $newId
* @param string $actionCommentIRC
* @param int $revId Id of associated revision, if any
+ * @param bool $isPatrollable Whether this log entry is patrollable
* @return RecentChange
*/
public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip,
$type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = '',
- $revId = 0 ) {
+ $revId = 0, $isPatrollable = false ) {
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;
+ // Allow unpatrolled status for patrollable log entries
+ $markPatrolled = $isPatrollable ? $user->isAllowed( 'autopatrol' ) : true;
$rc = new RecentChange;
$rc->mTitle = $target;
/** @var int ID of the log entry */
protected $id;
+ /** @var Can this log entry be patrolled? */
+ protected $isPatrollable = false;
+
/** @var bool Whether this is a legacy log entry */
protected $legacy = false;
$this->tags = $tags;
}
+ /**
+ * Set whether this log entry should be made patrollable
+ * This shouldn't depend on config, only on whether there is full support
+ * in the software for patrolling this log entry.
+ * False by default
+ *
+ * @since 1.27
+ * @param bool $patrollable
+ */
+ public function setIsPatrollable( $patrollable ) {
+ $this->isPatrollable = (bool)$patrollable;
+ }
+
/**
* Set the 'legacy' flag
*
LogEntryBase::makeParamBlob( $this->getParameters() ),
$newId,
$formatter->getIRCActionComment(), // Used for IRC feeds
- $this->getAssociatedRevId() // Used for e.g. moves and uploads
+ $this->getAssociatedRevId(), // Used for e.g. moves and uploads
+ $this->getIsPatrollable()
);
}
$rc->notifyRCFeeds();
}
- // Log the autopatrol if an associated rev id was passed
- if ( $this->getAssociatedRevId() > 0 &&
+ // Log the autopatrol if the log entry is patrollable
+ if ( $this->getIsPatrollable() &&
$rc->getAttribute( 'rc_patrolled' ) === 1 ) {
PatrolLog::record( $rc, true, $this->getPerformer() );
}
return $this->tags;
}
+ /**
+ * Whether this log entry is patrollable
+ *
+ * @since 1.27
+ * @return bool
+ */
+ public function getIsPatrollable() {
+ return $this->isPatrollable;
+ }
+
/**
* @since 1.25
* @return bool