Feeds for recent changes now provide URLs for the change (i.e., the diff), not just the page. This matches behavior of history feeds, which appears more correct. Incidentally, this code needs centralization, probably, say into a constructor method of Revision or Article. Logic is unnecessarily duplicated at present. (Also tweaked some docs, used __METHOD__ instead of $fname.)

This commit is contained in:
Aryeh Gregor 2007-11-18 02:33:30 +00:00
parent d9381d1622
commit c8136cd6a2
3 changed files with 10 additions and 4 deletions

View file

@ -157,6 +157,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
pages which had spaces in theirs names
* If restricted read access was enabled, requests for non-existing special pages
threw an exception
* Feeds for recent changes now provide correct URLs for the change, not just
the page
=== API changes in 1.12 ===

View file

@ -41,6 +41,7 @@ class FeedItem {
/**#@+
* @todo document
* @param $Url URL uniquely designating the item.
*/
function __construct( $Title, $Description, $Url, $Date = '', $Author = '', $Comments = '' ) {
$this->Title = $Title;

View file

@ -379,9 +379,12 @@ function rcOutputFeed( $rows, $feedFormat, $limit, $hideminor, $lastmod ) {
return true;
}
/**
* @todo document
* @param $rows Database resource with recentchanges rows
*/
function rcDoOutputFeed( $rows, &$feed ) {
$fname = 'rcDoOutputFeed';
wfProfileIn( $fname );
wfProfileIn( __METHOD__ );
$feed->outHeader();
@ -406,7 +409,7 @@ function rcDoOutputFeed( $rows, &$feed ) {
$item = new FeedItem(
$title->getPrefixedText(),
rcFormatDiff( $obj ),
$title->getFullURL(),
$title->getFullURL( 'diff=' . $obj->rc_this_oldid . '&oldid=prev' ),
$obj->rc_timestamp,
$obj->rc_user_text,
$talkpage->getFullURL()
@ -414,7 +417,7 @@ function rcDoOutputFeed( $rows, &$feed ) {
$feed->outItem( $item );
}
$feed->outFooter();
wfProfileOut( $fname );
wfProfileOut( __METHOD__ );
}
/**