Respect $wgShowUpdatedMarker
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 May 2008 23:39:20 +0000 (23:39 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 May 2008 23:39:20 +0000 (23:39 +0000)
includes/SpecialWatchlist.php
includes/User.php

index 94832f8..d97bbaa 100644 (file)
@@ -45,7 +45,7 @@ function wfSpecialWatchlist( $par ) {
        }
 
        $uid = $wgUser->getId();
-       if( $wgEnotifWatchlist && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) {
+       if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) {
                $wgUser->clearAllNotifications( $uid );
                $wgOut->redirect( $specialTitle->getFullUrl() );
                return;
@@ -154,7 +154,7 @@ function wfSpecialWatchlist( $par ) {
        if( $wgUser->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist) {
                $header .= wfMsg( 'wlheader-enotif' ) . "\n";
        }
-       if ( $wgEnotifWatchlist && $wgShowUpdatedMarker ) {
+       if ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) {
                $header .= wfMsg( 'wlheader-showupdated' ) . "\n";
        }
 
@@ -175,7 +175,7 @@ function wfSpecialWatchlist( $par ) {
        if( ( $lag = $dbr->getLag() ) > 0 )
                $wgOut->showLagWarning( $lag );
 
-       if ( $wgEnotifWatchlist && $wgShowUpdatedMarker ) {
+       if ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) {
                $wgOut->addHTML( '<form action="' .
                        $specialTitle->escapeLocalUrl() .
                        '" method="post"><input type="submit" name="dummy" value="' .
index 9ec8a34..837d758 100644 (file)
@@ -2006,13 +2006,12 @@ class User {
         * @public
         */
        function clearAllNotifications( $currentUser ) {
-               global $wgUseEnotif;
-               if ( !$wgUseEnotif ) {
+               global $wgUseEnotif, $wgShowUpdatedMarker;
+               if ( !$wgUseEnotif && !$wgShowUpdatedMarker ) {
                        $this->setNewtalk( false );
                        return;
                }
                if( $currentUser != 0 )  {
-
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->update( 'watchlist',
                                array( /* SET */
@@ -2021,8 +2020,7 @@ class User {
                                        'wl_user' => $currentUser
                                ), __METHOD__
                        );
-
-               #       we also need to clear here the "you have new message" notification for the own user_talk page
+               #       We also need to clear here the "you have new message" notification for the own user_talk page
                #       This is cleared one page view later in Article::viewUpdates();
                }
        }