Merge "Correctly use $wgFeedLimit in page history feed"
[lhc/web/wiklou.git] / includes / Article.php
index c8e6ce2..732b1c2 100644 (file)
@@ -1054,14 +1054,14 @@ class Article implements Page {
         * @return bool
         */
        public function showPatrolFooter() {
-               global $wgUseNPPatrol, $wgEnableAPI, $wgEnableWriteAPI;
+               global $wgUseNPPatrol, $wgUseRCPatrol, $wgEnableAPI, $wgEnableWriteAPI;
 
                $outputPage = $this->getContext()->getOutput();
                $user = $this->getContext()->getUser();
                $cache = wfGetMainCache();
                $rc = false;
 
-               if ( !$this->getTitle()->quickUserCan( 'patrol', $user ) || !$wgUseNPPatrol ) {
+               if ( !$this->getTitle()->quickUserCan( 'patrol', $user ) || !( $wgUseRCPatrol || $wgUseNPPatrol ) ) {
                        // Patrolling is disabled or the user isn't allowed to
                        return false;
                }
@@ -1546,13 +1546,7 @@ class Article implements Page {
 
                        $this->doDelete( $reason, $suppress );
 
-                       if ( $user->isLoggedIn() && $request->getCheck( 'wpWatch' ) != $user->isWatched( $title ) ) {
-                               if ( $request->getCheck( 'wpWatch' ) ) {
-                                       WatchAction::doWatch( $title, $user );
-                               } else {
-                                       WatchAction::doUnwatch( $title, $user );
-                               }
-                       }
+                       WatchAction::doWatchOrUnwatch( $request->getCheck( 'wpWatch' ), $title, $user );
 
                        return;
                }