]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/rss10action.php
Reworked File->getUrl to throw exception
[quix0rs-gnu-social.git] / lib / rss10action.php
index 7b6eed9c9688cbb1b7bfdee433e31908658f696b..6940ab4319590d34af19d63cea6edb7641e6b843 100644 (file)
@@ -107,7 +107,7 @@ class Rss10Action extends ManagedAction
      * @return array an array of Notice objects sorted in reverse chron
      */
 
-    protected function getNotices($limit=0)
+    protected function getNotices()
     {
         return array();
     }
@@ -209,22 +209,26 @@ class Rss10Action extends ManagedAction
         $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')));