hooks to allow changing RSS content

This commit is contained in:
Evan Prodromou 2010-08-13 11:44:26 -07:00
parent 91c914fa3b
commit ed8d8eb5ee
2 changed files with 61 additions and 48 deletions

View File

@ -1056,3 +1056,11 @@ EndNoticeSaveWeb: after saving a notice through the Web interface
- $action: action being executed (instance of NewNoticeAction)
- $notice: notice that was saved
StartRssEntryArray: at the start of copying a notice to an array
- $notice: the notice being copied
- &$entry: the entry (empty at beginning)
EndRssEntryArray: at the end of copying a notice to an array
- $notice: the notice being copied
- &$entry: the entry, with all the fields filled up

View File

@ -462,10 +462,12 @@ class ApiAction extends Action
function twitterRssEntryArray($notice)
{
$profile = $notice->getProfile();
$entry = array();
if (Event::handle('StartRssEntryArray', array($notice, &$entry))) {
$profile = $notice->getProfile();
// We trim() to avoid extraneous whitespace in the output
$entry['content'] = common_xml_safe_str(trim($notice->rendered));
@ -524,6 +526,9 @@ class ApiAction extends Action
$entry['geo'] = null;
}
Event::handle('EndRssEntryArray', array($notice, &$entry));
}
return $entry;
}