* When executed, it performs a nested call to the API to get the needed data,
* and formats it in a proper format.
*
- * @addtogroup API
+ * @ingroup API
*/
class ApiFeedWatchlist extends ApiBase {
'wllimit' => (50 > $wgFeedLimit) ? $wgFeedLimit : 50
);
+ if (!is_null($params['wlowner']))
+ $fauxReqArr['wlowner'] = $params['wlowner'];
+ if (!is_null($params['wltoken']))
+ $fauxReqArr['wltoken'] = $params['wltoken'];
+
// Check for 'allrev' parameter, and if found, show all revisions to each page on wl.
if ( ! is_null ( $params['allrev'] ) ) $fauxReqArr['wlallrev'] = '';
$data = $module->getResultData();
$feedItems = array ();
- foreach ($data['query']['watchlist'] as $info) {
+ foreach ((array)$data['query']['watchlist'] as $info) {
$feedItems[] = $this->createFeedItem($info);
}
ApiBase :: PARAM_MIN => 1,
ApiBase :: PARAM_MAX => 72,
),
- 'allrev' => null
+ 'allrev' => null,
+ 'wlowner' => array (
+ ApiBase :: PARAM_TYPE => 'user'
+ ),
+ 'wltoken' => array (
+ ApiBase :: PARAM_TYPE => 'string'
+ )
);
}
return array (
'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.'
+ 'allrev' => 'Include multiple revisions of the same page within given timeframe.',
+ 'wlowner' => "The user whose watchlist you want (must be accompanied by wltoken if it's not you)",
+ 'wltoken' => 'Security token that requested user set in their preferences'
);
}