/**
 * Format a diff for the newsfeed
 */
function rcFormatDiff($row)
{
    $titleObj = Title::makeTitle($row->rc_namespace, $row->rc_title);
    $timestamp = wfTimestamp(TS_MW, $row->rc_timestamp);
    return rcFormatDiffRow($titleObj, $row->rc_last_oldid, $row->rc_this_oldid, $timestamp, $row->rc_comment);
}
Example #2
0
 /**
  * Generate a FeedItem object from a given revision table row
  * Borrows Recent Changes' feed generation functions for formatting;
  * includes a diff to the previous revision (if any).
  *
  * @param $row
  * @return FeedItem
  */
 function feedItem($row)
 {
     $rev = new Revision($row);
     $rev->setTitle($this->mTitle);
     $text = rcFormatDiffRow($this->mTitle, $this->mTitle->getPreviousRevisionID($rev->getId()), $rev->getId(), $rev->getTimestamp(), $rev->getComment());
     if ($rev->getComment() == '') {
         global $wgContLang;
         $title = wfMsgForContent('history-feed-item-nocomment', $rev->getUserText(), $wgContLang->timeanddate($rev->getTimestamp()));
     } else {
         $title = $rev->getUserText() . ": " . $this->stripComment($rev->getComment());
     }
     return new FeedItem($title, $text, $this->mTitle->getFullUrl('diff=' . $rev->getId() . '&oldid=prev'), $rev->getTimestamp(), $rev->getUserText(), $this->mTitle->getTalkPage()->getFullUrl());
 }