Merge "User#getOption: Check ignoreHidden before $wgHiddenPrefs"
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 8340465..b322547 100644 (file)
@@ -58,16 +58,12 @@ class SpecialWatchlist extends SpecialPage {
                $this->checkPermissions();
 
                // Add feed links
-               $wlToken = $user->getOption( 'watchlisttoken' );
-               if ( !$wlToken ) {
-                       $wlToken = MWCryptRand::generateHex( 40 );
-                       $user->setOption( 'watchlisttoken', $wlToken );
-                       $user->saveSettings();
+               $wlToken = $user->getTokenFromOption( 'watchlisttoken' );
+               if ( $wlToken ) {
+                       $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
+                                                               'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
                }
 
-               $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
-                                                       'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
-
                $this->setHeaders();
                $this->outputHeader();
 
@@ -390,7 +386,9 @@ class SpecialWatchlist extends SpecialPage {
 
                # If there's nothing to show, stop here
                if ( $numRows == 0 ) {
-                       $output->addWikiMsg( 'watchnochange' );
+                       $output->wrapWikiMsg(
+                               "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
+                       );
                        return;
                }