Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / api / ApiPatrol.php
index 1230bab..6252882 100644 (file)
@@ -56,7 +56,18 @@ class ApiPatrol extends ApiBase {
                        }
                }
 
-               $retval = $rc->doMarkPatrolled( $this->getUser() );
+               $user = $this->getUser();
+               $tags = $params['tags'];
+
+               // Check if user can add tags
+               if ( !is_null( $tags ) ) {
+                       $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $tags, $user );
+                       if ( !$ableToTag->isOK() ) {
+                               $this->dieStatus( $ableToTag );
+                       }
+               }
+
+               $retval = $rc->doMarkPatrolled( $user, false, $tags );
 
                if ( $retval ) {
                        $this->dieUsageMsg( reset( $retval ) );
@@ -83,6 +94,10 @@ class ApiPatrol extends ApiBase {
                        'revid' => [
                                ApiBase::PARAM_TYPE => 'integer'
                        ],
+                       'tags' => [
+                               ApiBase::PARAM_TYPE => 'tags',
+                               ApiBase::PARAM_ISMULTI => true,
+                       ],
                ];
        }