Merge "Add additional tracking information to mediawiki.searchSuggest"
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index 2c95928..b6a0868 100644 (file)
@@ -430,9 +430,11 @@ class RecentChange {
         *
         * @param RecentChange|int $change RecentChange or corresponding rc_id
         * @param bool $auto For automatic patrol
+        * @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 array See doMarkPatrolled(), or null if $change is not an existing rc_id
         */
-       public static function markPatrolled( $change, $auto = false ) {
+       public static function markPatrolled( $change, $auto = false, $tags = null ) {
                global $wgUser;
 
                $change = $change instanceof RecentChange
@@ -443,7 +445,7 @@ class RecentChange {
                        return null;
                }
 
-               return $change->doMarkPatrolled( $wgUser, $auto );
+               return $change->doMarkPatrolled( $wgUser, $auto, $tags );
        }
 
        /**
@@ -453,9 +455,11 @@ class RecentChange {
         * 'markedaspatrollederror-noautopatrol' as errors
         * @param User $user User object doing the action
         * @param bool $auto For automatic patrol
+        * @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 array Array of permissions errors, see Title::getUserPermissionsErrors()
         */
-       public function doMarkPatrolled( User $user, $auto = false ) {
+       public function doMarkPatrolled( User $user, $auto = false, $tags = null ) {
                global $wgUseRCPatrol, $wgUseNPPatrol, $wgUseFilePatrol;
                $errors = [];
                // If recentchanges patrol is disabled, only new pages or new file versions
@@ -490,7 +494,8 @@ class RecentChange {
                // Actually set the 'patrolled' flag in RC
                $this->reallyMarkPatrolled();
                // Log this patrol event
-               PatrolLog::record( $this, $auto, $user );
+               PatrolLog::record( $this, $auto, $user, $tags );
+
                Hooks::run(
                                        'MarkPatrolledComplete',
                                        [ $this->getAttribute( 'rc_id' ), &$user, false, $auto ]