Followup r82727, improve comments, cast return value to bool

This commit is contained in:
Sam Reed 2011-02-24 16:00:06 +00:00
parent ab408b911d
commit 28f7bf1f2b
2 changed files with 5 additions and 2 deletions

View file

@ -2431,6 +2431,9 @@ class Article {
/**
* 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() {

View file

@ -602,8 +602,8 @@ abstract class ApiBase {
$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;