* @return array an array of Notice objects sorted in reverse chron
*/
- protected function getNotices($limit=0)
+ protected function getNotices()
{
return array();
}
$this->element('title', null, $title);
$this->element('link', null, $nurl);
$this->element('description', null, $profile->nickname."'s status on ".common_exact_date($notice->created));
- if ($notice->rendered) {
- $this->element('content:encoded', null, common_xml_safe_str($notice->rendered));
+ if ($notice->getRendered()) {
+ $this->element('content:encoded', null, common_xml_safe_str($notice->getRendered()));
}
$this->element('dc:date', null, common_date_w3dtf($notice->created));
$this->element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
$this->element('foaf:maker', array('rdf:resource' => $creator_uri));
$this->element('sioc:has_creator', array('rdf:resource' => $creator_uri.'#acct'));
- $location = $notice->getLocation();
- if ($location && isset($location->lat) && isset($location->lon)) {
- $location_uri = $location->getRdfURL();
- $attrs = array('geo:lat' => $location->lat,
- 'geo:long' => $location->lon);
- if (strlen($location_uri)) {
- $attrs['rdf:resource'] = $location_uri;
+ try {
+ $location = Notice_location::locFromStored($notice);
+ if (isset($location->lat) && isset($location->lon)) {
+ $location_uri = $location->getRdfURL();
+ $attrs = array('geo:lat' => $location->lat,
+ 'geo:long' => $location->lon);
+ if (strlen($location_uri)) {
+ $attrs['rdf:resource'] = $location_uri;
+ }
+ $this->element('statusnet:origin', $attrs);
}
- $this->element('statusnet:origin', $attrs);
+ } catch (ServerException $e) {
+ // No result, so no location data
}
$this->element('statusnet:postIcon', array('rdf:resource' => $profile->avatarUrl()));
$this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));