SPQRobin has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/132590

Change subject: Always link to diff in watchlist feed
......................................................................

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
---
M includes/api/ApiFeedWatchlist.php
1 file changed, 3 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/132590/1

diff --git a/includes/api/ApiFeedWatchlist.php 
b/includes/api/ApiFeedWatchlist.php
index 545b94d..64c3eec 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 @@
                                '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 )
@@ -93,12 +92,6 @@
                        }
                        if ( $params['wltype'] !== null ) {
                                $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
@@ -173,7 +166,7 @@
        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 @@
                                ApiBase::PARAM_MIN => 1,
                                ApiBase::PARAM_MAX => 72,
                        ),
-                       'linktodiffs' => false,
                        'linktosections' => false,
                );
                if ( $flags ) {
@@ -254,7 +246,6 @@
                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 @@
        public function getExamples() {
                return array(
                        'api.php?action=feedwatchlist',
-                       
'api.php?action=feedwatchlist&allrev=&linktodiffs=&hours=6'
+                       'api.php?action=feedwatchlist&allrev=&hours=6'
                );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/132590
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0917844219be773ce24b4c6bac9b7d0d5a4b922d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: SPQRobin <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to