From 480257da0d92ec759b93d14b3ea6476c47e2fc01 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 25 Mar 2010 22:31:41 +0000 Subject: [PATCH] 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 --- includes/api/ApiUpload.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() ); -- 2.20.1