Cleanup watchlist preference usage
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 8 Nov 2013 18:01:28 +0000 (13:01 -0500)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 8 Nov 2013 20:12:55 +0000 (20:12 +0000)
commit4101ab54f2a3ab0a8543090879be39395baf0e79
tree6cce282f81f034c53d70c42948183022ffdfd5c0
parent00812bd08265a1bca368e2682d621a543ed75c54
Cleanup watchlist preference usage

In general, the web UI does a check of the watchlist preferences along
the lines of "watch if watchdefault, or if watchcreations and the title
doesn't exist". So there's no way to have it watch edits but not
creations. Make the API behavior match this.

For API action=protect&watchlist=preferences, we want to use
'watchdefault' always to match the behavior of the web UI.

For Special:Upload, the code is all there to do a "watch if
watchdefault, or if watchcreations and the file doesn't exist". But for
some reason that code wasn't being used in favor of just using
watchcreations all the time. Fix that, too. And have the API use that
instead of checking if the file page exists.

Bug: 56766
Change-Id: I57fc46d9a97b3ea2169173727db842d0d7ecf81d
includes/api/ApiBase.php
includes/api/ApiProtect.php
includes/api/ApiUpload.php
includes/specials/SpecialUpload.php