X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Flogging%2FPatrolLog.php;h=d1de2cd3aedefb86230d561eef6229b186390329;hb=b7d1782e1055cd04338293d1c5ce0f09ffadbff4;hp=510c71150d430fbe7c02b0ae1cc1e5c73fe6dc30;hpb=fb7b3eebeb8de47eb42e8d6ccf204106a2d6d9e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/PatrolLog.php b/includes/logging/PatrolLog.php index 510c71150d..d1de2cd3ae 100644 --- a/includes/logging/PatrolLog.php +++ b/includes/logging/PatrolLog.php @@ -33,10 +33,12 @@ class PatrolLog { * @param int|RecentChange $rc Change identifier or RecentChange object * @param bool $auto Was this patrol event automatic? * @param User $user User performing the action or null to use $wgUser + * @param string|string[] $tags Change tags to add to the patrol log entry + * ($user should be able to add the specified tags before this is called) * * @return bool */ - public static function record( $rc, $auto = false, User $user = null ) { + public static function record( $rc, $auto = false, User $user = null, $tags = null ) { global $wgLogAutopatrol; // do not log autopatrolled edits if setting disables it @@ -56,10 +58,13 @@ class PatrolLog { $user = $wgUser; } - $entry = new ManualLogEntry( 'patrol', 'patrol' ); + $action = $auto ? 'autopatrol' : 'patrol'; + + $entry = new ManualLogEntry( 'patrol', $action ); $entry->setTarget( $rc->getTitle() ); $entry->setParameters( self::buildParams( $rc, $auto ) ); $entry->setPerformer( $user ); + $entry->setTags( $tags ); $logid = $entry->insert(); if ( !$auto ) { $entry->publish( $logid, 'udp' );