*
* Created on Oct 13, 2006
*
- * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( "ApiBase.php" );
-}
-
/**
* This action allows users to get their watchlist items in RSS/Atom formats.
* When executed, it performs a nested call to the API to get the needed data,
if( !isset( $wgFeedClasses[ $params['feedformat'] ] ) ) {
$this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );
}
+ if ( !is_null( $params['wlexcludeuser'] ) ) {
+ $fauxReqArr['wlexcludeuser'] = $params['wlexcludeuser'];
+ }
// limit to the number of hours going from now back
$endTime = wfTimestamp( TS_MW, time() - intval( $params['hours'] * 60 * 60 ) );
$feedItems[] = $this->createFeedItem( $info );
}
- $msg = wfMsgForContent( 'watchlist' );
+ $msg = wfMessage( 'watchlist' )->inContentLanguage()->text();
$feedTitle = $wgSitename . ' - ' . $msg . ' [' . $wgLanguageCode . ']';
$feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL();
// Error results should not be cached
$this->getMain()->setCacheMaxAge( 0 );
- $feedTitle = $wgSitename . ' - Error - ' . wfMsgForContent( 'watchlist' ) . ' [' . $wgLanguageCode . ']';
+ $feedTitle = $wgSitename . ' - Error - ' . wfMessage( 'watchlist' )->inContentLanguage()->text() . ' [' . $wgLanguageCode . ']';
$feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL();
$feedFormat = isset( $params['feedformat'] ) ? $params['feedformat'] : 'rss';
- $feed = new $wgFeedClasses[$feedFormat] ( $feedTitle, htmlspecialchars( wfMsgForContent( 'watchlist' ) ), $feedUrl );
+ $msg = wfMessage( 'watchlist' )->inContentLanguage()->escaped();
+ $feed = new $wgFeedClasses[$feedFormat] ( $feedTitle, $msg, $feedUrl );
if ( $e instanceof UsageException ) {
$errorCode = $e->getCodeString();
}
}
+ /**
+ * @param $info array
+ * @return FeedItem
+ */
private function createFeedItem( $info ) {
$titleStr = $info['title'];
$title = Title::newFromText( $titleStr );
'wltoken' => array(
ApiBase::PARAM_TYPE => 'string'
),
+ 'wlexcludeuser' => array(
+ ApiBase::PARAM_TYPE => 'user'
+ ),
'linktodiffs' => false,
);
}
'feedformat' => 'The format of the feed',
'hours' => 'List pages modified within this many hours from now',
'allrev' => 'Include multiple revisions of the same page within given timeframe',
- 'wlowner' => "The user whose watchlist you want (must be accompanied by {$this->getModulePrefix()}token if it's not you)",
+ 'wlowner' => "The user whose watchlist you want (must be accompanied by {$this->getModulePrefix()}wltoken if it's not you)",
'wltoken' => 'Security token that requested user set in their preferences',
- 'linktodiffs' => 'Link to change differences instead of article pages'
+ 'wlexcludeuser' => 'A user whose edits should not be shown in the watchlist',
+ 'linktodiffs' => 'Link to change differences instead of article pages',
);
}
}
public function getHelpUrls() {
- return 'http://www.mediawiki.org/wiki/API:Watchlist_feed';
+ return 'https://www.mediawiki.org/wiki/API:Watchlist_feed';
}
public function getVersion() {