Always link to diff in watchlist feed
authorrobin <robinp.1273@gmail.com>
Sat, 10 May 2014 01:54:54 +0000 (03:54 +0200)
committerReedy <reedy@wikimedia.org>
Sat, 10 May 2014 16:01:12 +0000 (16:01 +0000)
Remove option to link to diffs in watchlist feed instead of the page itself, which was disabled by default.
This makes it consistent with the contributions feed when Change-Id: Ie33e2ba90e7a7566d0e0925220b8fd12b1928513 is merged.
For these changes feeds it makes sense to always link to the actual diffs.

See also bug 10268.

Change-Id: I0917844219be773ce24b4c6bac9b7d0d5a4b922d

includes/api/ApiFeedWatchlist.php

index 545b94d..64c3eec 100644 (file)
@@ -34,7 +34,6 @@
 class ApiFeedWatchlist extends ApiBase {
 
        private $watchlistModule = null;
-       private $linkToDiffs = false;
        private $linkToSections = false;
 
        /**
@@ -73,7 +72,7 @@ class ApiFeedWatchlist extends ApiBase {
                                'meta' => 'siteinfo',
                                'siprop' => 'general',
                                'list' => 'watchlist',
-                               'wlprop' => 'title|user|comment|timestamp',
+                               'wlprop' => 'title|user|comment|timestamp|ids',
                                'wldir' => 'older', // reverse order - from newest to oldest
                                'wlend' => $endTime, // stop at this time
                                'wllimit' => min( 50, $wgFeedLimit )
@@ -95,12 +94,6 @@ class ApiFeedWatchlist extends ApiBase {
                                $fauxReqArr['wltype'] = $params['wltype'];
                        }
 
-                       // Support linking to diffs instead of article
-                       if ( $params['linktodiffs'] ) {
-                               $this->linkToDiffs = true;
-                               $fauxReqArr['wlprop'] .= '|ids';
-                       }
-
                        // Support linking directly to sections when possible
                        // (possible only if section name is present in comment)
                        if ( $params['linktosections'] ) {
@@ -173,7 +166,7 @@ class ApiFeedWatchlist extends ApiBase {
        private function createFeedItem( $info ) {
                $titleStr = $info['title'];
                $title = Title::newFromText( $titleStr );
-               if ( $this->linkToDiffs && isset( $info['revid'] ) ) {
+               if ( isset( $info['revid'] ) ) {
                        $titleUrl = $title->getFullURL( array( 'diff' => $info['revid'] ) );
                } else {
                        $titleUrl = $title->getFullURL();
@@ -225,7 +218,6 @@ class ApiFeedWatchlist extends ApiBase {
                                ApiBase::PARAM_MIN => 1,
                                ApiBase::PARAM_MAX => 72,
                        ),
-                       'linktodiffs' => false,
                        'linktosections' => false,
                );
                if ( $flags ) {
@@ -254,7 +246,6 @@ class ApiFeedWatchlist extends ApiBase {
                return array(
                        'feedformat' => 'The format of the feed',
                        'hours' => 'List pages modified within this many hours from now',
-                       'linktodiffs' => 'Link to change differences instead of article pages',
                        'linktosections' => 'Link directly to changed sections if possible',
                        'allrev' => $wldescr['allrev'],
                        'wlowner' => $wldescr['owner'],
@@ -279,7 +270,7 @@ class ApiFeedWatchlist extends ApiBase {
        public function getExamples() {
                return array(
                        'api.php?action=feedwatchlist',
-                       'api.php?action=feedwatchlist&allrev=&linktodiffs=&hours=6'
+                       'api.php?action=feedwatchlist&allrev=&hours=6'
                );
        }