From: Sam Reed Date: Thu, 25 Mar 2010 22:31:41 +0000 (+0000) Subject: Minor followup to r64197 X-Git-Tag: 1.31.0-rc.0~37347 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=480257da0d92ec759b93d14b3ea6476c47e2fc01;p=lhc%2Fweb%2Fwiklou.git Minor followup to r64197 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 --- diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index eabb7e2386..0206744bb9 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -236,8 +236,13 @@ class ApiUpload extends ApiBase { $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() );