- if($params['watch'])
- $watch = true;
- else if($params['unwatch'])
- $watch = false;
- else if($titleObj->userIsWatching())
- $watch = true;
- else if($wgUser->getOption('watchdefault'))
- $watch = true;
- else if($wgUser->getOption('watchcreations') && !$titleObj->exists())
+ // Handle watchlist settings
+ switch ($params['watchlist'])
+ {
+ case 'watch':
+ $watch = true;
+ break;
+ case 'unwatch':
+ $watch = false;
+ break;
+ case 'preferences':
+ if ($titleObj->exists())
+ $watch = $wgUser->getOption('watchdefault');
+ else
+ $watch = $wgUser->getOption('watchcreations');
+ break;
+ case 'nochange':
+ default:
+ $watch = $titleObj->userIsWatching();
+ }
+ // Deprecated parameters
+ if ($params['watch'])
+ {