/**
* Add this page to $wgUser's watchlist
+ *
+ * This is safe to be called multiple times
+ *
* @return bool true on successful watch operation
*/
public function doWatch() {
$userOption = $titleObj->exists()
? 'watchdefault' : 'watchcreations';
}
- # If the corresponding user option is true, watch, don't
- return $wgUser->getOption( $userOption ) ? true : false;
+ # Watch the article based on the user preference
+ return (bool)$wgUser->getOption( $userOption );
case 'nochange':
return $userWatching;