From f930d0c5a2af10b48a1af2c8500c42f628b7fefe Mon Sep 17 00:00:00 2001 From: robin Date: Sat, 10 May 2014 03:54:54 +0200 Subject: [PATCH] Always link to diff in watchlist feed 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 | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 545b94d767..64c3eec120 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -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' ); } -- 2.20.1