Allow unwatch via ApiUpload, UploadBase doesn't allow/cater for unwatching, so use the $wgUser object to do it, rather than possibly causing a breaking change in UploadBase
$this->dieUsage( 'An internal error occurred', 'internal-error', 0, $error );
}
-
+
$file = $this->mUpload->getLocalFile();
+
+ if ( !$watch ) {
+ $wgUser->removeWatch( $file->getTitle() );
+ }
+
$result['result'] = 'Success';
$result['filename'] = $file->getName();
$result['imageinfo'] = $this->mUpload->getImageInfo( $this->getResult() );