]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Change geopoint to location
authorEvan Prodromou <evan@e14n.com>
Tue, 4 Jun 2013 21:22:51 +0000 (17:22 -0400)
committerEvan Prodromou <evan@e14n.com>
Tue, 4 Jun 2013 21:22:51 +0000 (17:22 -0400)
lib/activityobject.php

index 8ae2e6e9779cba093ed75b60eafd1d77cab56ec8..9640f025b2faace3cd1446d120262c264eebd749 100644 (file)
@@ -778,12 +778,29 @@ class ActivityObject
 
             if (!empty($this->geopoint)) {
 
-                list($lat, $long) = explode(' ', $this->geopoint);
+                list($lat, $lon) = explode(' ', $this->geopoint);
 
-                $object['geopoint'] = array(
-                    'type'        => 'Point',
-                    'coordinates' => array($lat, $long)
+                $object['location'] = array(
+                    'objectType' => 'place',
+                    'position' => sprintf("%+02.5F%+03.5F/", $lat, $lon),
+                    'lat' => $lat,
+                    'lon' => $lon
                 );
+
+                $loc = Location::fromLatLon($lat, $lon);
+
+                if ($loc) {
+                    $name = $loc->getName();
+
+                    if ($name) {
+                        $object['location']['displayName'] = $name;
+                    }
+                    $url = $loc->getURL();
+
+                    if ($url) {
+                        $object['location']['url'] = $url;
+                    }
+                }
             }
 
             if (!empty($this->poco)) {