- // GeoJSON
-
- $activity['geopoint'] = array(
- 'type' => 'Point',
- 'coordinates' => array($loc->lat, $loc->lon),
- 'deprecated' => true,
- );
-
- $activity['location'] = array(
- 'objectType' => 'place',
- 'position' => sprintf("%+02.5F%+03.5F/", $loc->lat, $loc->lon),
- 'lat' => $loc->lat,
- 'lon' => $loc->lon
- );
+ if (count($this->objects) == 0) {
+ common_log(LOG_ERR, "Can't save " . $this->id);
+ } else {
+ if (count($this->objects) > 1) {
+ common_log(LOG_WARNING, "Ignoring " . (count($this->objects) - 1) . " extra objects in JSON output for activity " . $this->id);
+ }
+ $object = $this->objects[0];
+
+ if ($object instanceof Activity) {
+ // Sharing a post activity is more like sharing the original object
+ if (ActivityVerb::canonical($this->verb) == ActivityVerb::canonical(ActivityVerb::SHARE) &&
+ ActivityVerb::canonical($object->verb) == ActivityVerb::canonical(ActivityVerb::POST)) {
+ // XXX: Here's one for the obfuscation record books
+ $object = $object->objects[0];
+ }
+ }