]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Output enclosing geo elements and GeoRSS xmlns in XML timelines
authorZach Copley <zach@status.net>
Fri, 12 Mar 2010 05:39:36 +0000 (05:39 +0000)
committerZach Copley <zach@status.net>
Fri, 12 Mar 2010 05:39:36 +0000 (05:39 +0000)
lib/apiaction.php

index b9060786282158bb3176b7edc8e538fb12027a67..e6aaf931618ec48ff037465b27faa5cd207ae2fb 100644 (file)
@@ -491,7 +491,7 @@ class ApiAction extends Action
                 $this->showXmlAttachments($twitter_status['attachments']);
                 break;
             case 'geo':
-                $this->showGeoRSS($value);
+                $this->showGeoXML($value);
                 break;
             case 'retweeted_status':
                 $this->showTwitterXmlStatus($value, 'retweeted_status');
@@ -539,6 +539,18 @@ class ApiAction extends Action
         }
     }
 
+    function showGeoXML($geo)
+    {
+        if (empty($geo)) {
+            // empty geo element
+            $this->element('geo');
+        } else {
+            $this->elementStart('geo', array('xmlns:georss' => 'http://www.georss.org/georss'));
+            $this->element('georss:point', null, $geo['coordinates'][0] . ' ' . $geo['coordinates'][1]);
+            $this->elementEnd('geo');
+        }
+    }
+
     function showGeoRSS($geo)
     {
         if (!empty($geo)) {